diff options
author | Quentin Smith <quentin@mit.edu> | 2011-04-19 13:53:54 -0400 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2011-05-18 12:06:38 -0700 |
commit | edc93f89e17707002aad68023256316a0d820168 (patch) | |
tree | eb65e88cf49a58e51474ec442df108080dd4db58 /sys/avc | |
parent | 5ce26c5cc72aa3a0a817093e981f180ef82081c7 (diff) | |
download | gstreamer-plugins-bad-edc93f89e17707002aad68023256316a0d820168.tar.gz |
avc: Track the number of enqueued and dequeued packets
Diffstat (limited to 'sys/avc')
-rw-r--r-- | sys/avc/gstavcsrc.cpp | 11 | ||||
-rw-r--r-- | sys/avc/gstavcsrc.h | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/sys/avc/gstavcsrc.cpp b/sys/avc/gstavcsrc.cpp index e71c35026..37f8dbd1f 100644 --- a/sys/avc/gstavcsrc.cpp +++ b/sys/avc/gstavcsrc.cpp @@ -237,6 +237,7 @@ MyStructuredDataPushProc (UInt32 CycleDataCount, pCycleData[cycle].pBuf[sourcePacket], kMPEG2TSPacketSize); gst_atomic_queue_push (avcsrc->queue, buffer); + avcsrc->packets_enqueued++; } } @@ -321,6 +322,9 @@ gst_avc_src_stop (GstBaseSrc * src) // Forget about the device (don't destroy it; pAVCDeviceController manages it) avcsrc->pAVCDevice = nil; + GST_DEBUG("Packets enqueued = %llu", avcsrc->packets_enqueued); + GST_DEBUG("Packets dequeued = %llu", avcsrc->packets_dequeued); + while ((buffer = GST_BUFFER (gst_atomic_queue_pop (avcsrc->queue))) != NULL) { gst_buffer_unref (buffer); } @@ -358,7 +362,10 @@ gst_avc_src_event (GstBaseSrc * src, GstEvent * event) { GstAVCSrc *avcsrc = GST_AVC_SRC (src); - GST_DEBUG_OBJECT (avcsrc, "event"); + GST_DEBUG_OBJECT (avcsrc, "event of type '%s'", GST_EVENT_TYPE_NAME(event)); + + GST_DEBUG("Packets enqueued = %llu, dequeued = %llu", + avcsrc->packets_enqueued, avcsrc->packets_dequeued); return TRUE; } @@ -390,6 +397,8 @@ gst_avc_src_create (GstBaseSrc * src, guint64 offset, guint size, *buf = buffer; + avcsrc->packets_dequeued++; + return GST_FLOW_OK; } diff --git a/sys/avc/gstavcsrc.h b/sys/avc/gstavcsrc.h index 9d1f0bd93..e0fcf437e 100644 --- a/sys/avc/gstavcsrc.h +++ b/sys/avc/gstavcsrc.h @@ -46,6 +46,9 @@ struct _GstAVCSrc AVCDeviceStream *pAVCDeviceStream; int deviceIndex; + guint64 packets_enqueued; + guint64 packets_dequeued; + GstAtomicQueue *queue; GCond *cond; GMutex *queue_lock; |