summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-08-16 12:12:06 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-08-16 12:13:25 +0200
commitbdc056c12d283d0970284aec189a3f9456809799 (patch)
tree190d9d44f5357c2458e79f85e0d7eead396ffcb7 /gst-libs
parentd1dc65d6ee46bb99d9dbbb95adf51df4604e95e1 (diff)
video: Add methods to return a list of all pending GstVideoCodecFrames
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/video/gstvideodecoder.c21
-rw-r--r--gst-libs/gst/video/gstvideodecoder.h6
-rw-r--r--gst-libs/gst/video/gstvideoencoder.c21
-rw-r--r--gst-libs/gst/video/gstvideoencoder.h2
4 files changed, 48 insertions, 2 deletions
diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c
index 59449c476..009724171 100644
--- a/gst-libs/gst/video/gstvideodecoder.c
+++ b/gst-libs/gst/video/gstvideodecoder.c
@@ -2646,6 +2646,27 @@ gst_video_decoder_get_frame (GstVideoDecoder * decoder, int frame_number)
return frame;
}
+/**
+ * gst_video_decoder_get_frames:
+ * @decoder: a #GstVideoDecoder
+ *
+ * Get all pending unfinished #GstVideoCodecFrame
+ *
+ * Returns: (transfer full) (element-type GstVideoCodecFrame): pending unfinished #GstVideoCodecFrame.
+ */
+GList *
+gst_video_decoder_get_frames (GstVideoDecoder * decoder)
+{
+ GList *frames;
+
+ GST_VIDEO_DECODER_STREAM_LOCK (decoder);
+ frames = g_list_copy (decoder->priv->frames);
+ g_list_foreach (frames, (GFunc) gst_video_codec_frame_ref, NULL);
+ GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
+
+ return frames;
+}
+
static gboolean
gst_video_decoder_decide_allocation_default (GstVideoDecoder * decoder,
GstQuery * query)
diff --git a/gst-libs/gst/video/gstvideodecoder.h b/gst-libs/gst/video/gstvideodecoder.h
index 49e080f9f..54f4561bb 100644
--- a/gst-libs/gst/video/gstvideodecoder.h
+++ b/gst-libs/gst/video/gstvideodecoder.h
@@ -316,11 +316,13 @@ GstBufferPool *gst_video_decoder_get_buffer_pool (GstVideoDecoder *decoder);
/* Object methods */
-GstVideoCodecFrame *gst_video_decoder_get_frame (GstVideoDecoder *decoder,
- int frame_number);
+GstVideoCodecFrame *gst_video_decoder_get_frame (GstVideoDecoder *decoder,
+ int frame_number);
GstVideoCodecFrame *gst_video_decoder_get_oldest_frame (GstVideoDecoder *decoder);
+GList * gst_video_decoder_get_frames (GstVideoDecoder *decoder);
+
/* Parsing related methods */
void gst_video_decoder_add_to_frame (GstVideoDecoder *decoder,
int n_bytes);
diff --git a/gst-libs/gst/video/gstvideoencoder.c b/gst-libs/gst/video/gstvideoencoder.c
index 605ebf561..9c41a7e6f 100644
--- a/gst-libs/gst/video/gstvideoencoder.c
+++ b/gst-libs/gst/video/gstvideoencoder.c
@@ -2007,6 +2007,27 @@ gst_video_encoder_get_frame (GstVideoEncoder * encoder, int frame_number)
}
/**
+ * gst_video_encoder_get_frames:
+ * @encoder: a #GstVideoEncoder
+ *
+ * Get all pending unfinished #GstVideoCodecFrame
+ *
+ * Returns: (transfer full) (element-type GstVideoCodecFrame): pending unfinished #GstVideoCodecFrame.
+ */
+GList *
+gst_video_encoder_get_frames (GstVideoEncoder * encoder)
+{
+ GList *frames;
+
+ GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
+ frames = g_list_copy (encoder->priv->frames);
+ g_list_foreach (frames, (GFunc) gst_video_codec_frame_ref, NULL);
+ GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
+
+ return frames;
+}
+
+/**
* gst_video_encoder_merge_tags:
* @encoder: a #GstVideoEncoder
* @tags: a #GstTagList to merge
diff --git a/gst-libs/gst/video/gstvideoencoder.h b/gst-libs/gst/video/gstvideoencoder.h
index ffc45dbe3..a260c6c20 100644
--- a/gst-libs/gst/video/gstvideoencoder.h
+++ b/gst-libs/gst/video/gstvideoencoder.h
@@ -268,6 +268,8 @@ GstVideoCodecFrame* gst_video_encoder_get_frame (GstVideoEncoder *encode
int frame_number);
GstVideoCodecFrame* gst_video_encoder_get_oldest_frame (GstVideoEncoder *encoder);
+GList * gst_video_encoder_get_frames (GstVideoEncoder *encoder);
+
GstBuffer * gst_video_encoder_allocate_output_buffer (GstVideoEncoder * encoder,
gsize size);