Re: dvgrab wait for device

Carl Karsten <[email protected]>
Newsgroups gmane.comp.video.kino.devel
Message-ID <[email protected]>
On Tue, Jun 30, 2009 at 2:05 PM, Dan Dennedy<[email protected]> wrote:
> On Tue, Jun 30, 2009 at 11:32 AM, Carl Karsten<[email protected]> wrote:
>> skipped trying to figure out how to add parameters (and given the 10
>
> I could do that easily.

works for me.

>
>> second time out isn't documented, does it really have to be kept?)
>
> This does help with troubleshooting. When it is reported (and not
> using combination of -card and -noavc), then I know that the camera is
> detected but iso data is not received. If it is not reported, all I
> really know is that "it does not work." I suppose as an alternative, I
> could display a message every 10 seconds and keep trying.

This may take care of that:

    sendEvent( "Looking for DV data..." );
    while ( !g_done && m_frame == NULL )

Which personally I like because it tells me it got to that point. If
more messages will help you, wont' bother me.

Attached is a patch.  should I post it to the sf site too?  guessing
it so trivial it will be easier for you to just hack the code.

-- 
Carl K

------------------------------------------------------------------------------

_______________________________________________
Kino-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kino-dev
dvgrab.cc.diff (text/x-diff, 1.5 KB)
Index: a/dvgrab.cc
===================================================================
RCS file: /cvsroot/kino/dvgrab/dvgrab.cc,v
retrieving revision 1.71
diff -u -r1.71 dvgrab.cc
--- a/dvgrab.cc	11 Apr 2009 04:51:29 -0000	1.71
+++ a/dvgrab.cc	30 Jun 2009 19:13:04 -0000
@@ -515,8 +515,6 @@
 
 void DVgrab::startCapture()
 {
-	int tryCounter = 400;
-
 	if ( m_dst_file_name )
 	{
 		pthread_mutex_lock( &capture_mutex );
@@ -625,16 +623,17 @@
 			m_avc->Play( m_node );
 	}
 
-	// Wait up to N seconds to see if we got any data
+	// Wait indefinately for data. 
 	// this is a little unclean, checking global g_done from main.cc to allow interruption
-	while ( !g_done && m_frame == NULL && tryCounter-- > 0 )
+	sendEvent( "Looking for DV data..." );
+	while ( !g_done && m_frame == NULL )
 	{
 		timespec t = {0, 25000000L};
 		nanosleep( &t, NULL );
 	}
 
-	// OK, we have data, commence capture
 	if ( !g_done && m_frame )
+	// OK, we have data, commence capture
 	{
 		sendEvent( "Capture Started" );
 		m_captureActive = true;
@@ -648,8 +647,9 @@
 			pthread_mutex_unlock( &capture_mutex );
 	}
 	
-	// No data received in N seconds, throw an error
 	else if ( !g_done )
+	// No data received in N seconds, throw an error
+    // CFK: not sure this case can happen now that timeout was removed
 	{
 		if ( m_dst_file_name )
 			pthread_mutex_unlock( &capture_mutex );
@@ -659,6 +659,7 @@
 		throw std::string( err );
 	}
 	else
+	// g_done true, perhaps ^C
 	{
 		if ( m_dst_file_name )
 			pthread_mutex_unlock( &capture_mutex );
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.