mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
avc: Track the number of enqueued and dequeued packets
This commit is contained in:
parent
5ce26c5cc7
commit
edc93f89e1
2 changed files with 13 additions and 1 deletions
|
@ -237,6 +237,7 @@ MyStructuredDataPushProc (UInt32 CycleDataCount,
|
||||||
pCycleData[cycle].pBuf[sourcePacket], kMPEG2TSPacketSize);
|
pCycleData[cycle].pBuf[sourcePacket], kMPEG2TSPacketSize);
|
||||||
|
|
||||||
gst_atomic_queue_push (avcsrc->queue, buffer);
|
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)
|
// Forget about the device (don't destroy it; pAVCDeviceController manages it)
|
||||||
avcsrc->pAVCDevice = nil;
|
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) {
|
while ((buffer = GST_BUFFER (gst_atomic_queue_pop (avcsrc->queue))) != NULL) {
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
}
|
}
|
||||||
|
@ -358,7 +362,10 @@ gst_avc_src_event (GstBaseSrc * src, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstAVCSrc *avcsrc = GST_AVC_SRC (src);
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -390,6 +397,8 @@ gst_avc_src_create (GstBaseSrc * src, guint64 offset, guint size,
|
||||||
|
|
||||||
*buf = buffer;
|
*buf = buffer;
|
||||||
|
|
||||||
|
avcsrc->packets_dequeued++;
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,9 @@ struct _GstAVCSrc
|
||||||
AVCDeviceStream *pAVCDeviceStream;
|
AVCDeviceStream *pAVCDeviceStream;
|
||||||
int deviceIndex;
|
int deviceIndex;
|
||||||
|
|
||||||
|
guint64 packets_enqueued;
|
||||||
|
guint64 packets_dequeued;
|
||||||
|
|
||||||
GstAtomicQueue *queue;
|
GstAtomicQueue *queue;
|
||||||
GCond *cond;
|
GCond *cond;
|
||||||
GMutex *queue_lock;
|
GMutex *queue_lock;
|
||||||
|
|
Loading…
Reference in a new issue