mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
omxvideodec: Add API for subclasses to prepare/convert frames
This commit is contained in:
parent
febb83ec54
commit
bb1dd8aaba
2 changed files with 14 additions and 0 deletions
|
@ -1134,18 +1134,31 @@ gst_omx_video_dec_handle_frame (GstBaseVideoDecoder * decoder,
|
||||||
{
|
{
|
||||||
GstOMXAcquireBufferReturn acq_ret = GST_OMX_ACQUIRE_BUFFER_ERROR;
|
GstOMXAcquireBufferReturn acq_ret = GST_OMX_ACQUIRE_BUFFER_ERROR;
|
||||||
GstOMXVideoDec *self;
|
GstOMXVideoDec *self;
|
||||||
|
GstOMXVideoDecClass *klass;
|
||||||
GstOMXBuffer *buf;
|
GstOMXBuffer *buf;
|
||||||
GstBuffer *codec_data = NULL;
|
GstBuffer *codec_data = NULL;
|
||||||
guint offset = 0;
|
guint offset = 0;
|
||||||
GstClockTime timestamp, duration, timestamp_offset = 0;
|
GstClockTime timestamp, duration, timestamp_offset = 0;
|
||||||
|
|
||||||
self = GST_OMX_VIDEO_DEC (decoder);
|
self = GST_OMX_VIDEO_DEC (decoder);
|
||||||
|
klass = GST_OMX_VIDEO_DEC_GET_CLASS (self);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Handling frame");
|
GST_DEBUG_OBJECT (self, "Handling frame");
|
||||||
|
|
||||||
timestamp = frame->presentation_timestamp;
|
timestamp = frame->presentation_timestamp;
|
||||||
duration = frame->presentation_duration;
|
duration = frame->presentation_duration;
|
||||||
|
|
||||||
|
if (klass->prepare_frame) {
|
||||||
|
GstFlowReturn ret;
|
||||||
|
|
||||||
|
ret = klass->prepare_frame (self, frame);
|
||||||
|
if (ret != GST_FLOW_OK) {
|
||||||
|
GST_ERROR_OBJECT (self, "Preparing frame failed: %s",
|
||||||
|
gst_flow_get_name (ret));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while (offset < GST_BUFFER_SIZE (frame->sink_buffer)) {
|
while (offset < GST_BUFFER_SIZE (frame->sink_buffer)) {
|
||||||
/* Make sure to release the base class stream lock, otherwise
|
/* Make sure to release the base class stream lock, otherwise
|
||||||
* _loop() can't call _finish_frame() and we might block forever
|
* _loop() can't call _finish_frame() and we might block forever
|
||||||
|
|
|
@ -77,6 +77,7 @@ struct _GstOMXVideoDecClass
|
||||||
|
|
||||||
gboolean (*is_format_change) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoState * state);
|
gboolean (*is_format_change) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoState * state);
|
||||||
gboolean (*set_format) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoState * state);
|
gboolean (*set_format) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoState * state);
|
||||||
|
GstFlowReturn (*prepare_frame) (GstOMXVideoDec * self, GstVideoFrame *frame);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_omx_video_dec_get_type (void);
|
GType gst_omx_video_dec_get_type (void);
|
||||||
|
|
Loading…
Reference in a new issue