summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2013-12-10 11:10:54 +0100
committerAlessandro Decina <alessandro.d@gmail.com>2013-12-10 11:12:56 +0100
commit7dffa2e1f22ee4c94fb989aebf5ef48796cacee0 (patch)
tree69573ee1359eb46e30847ac7a5cfd312a9823879 /sys
parent631d5d94ed404afa04c5e62dc105d4798166e09f (diff)
downloadgstreamer-plugins-bad-7dffa2e1f22ee4c94fb989aebf5ef48796cacee0.tar.gz
applemedia: vtdec: set the correct video format in the video meta
Fixes all kinds of weird bugs when videoconvert is used with the decoder.
Diffstat (limited to 'sys')
-rw-r--r--sys/applemedia/corevideobuffer.c5
-rw-r--r--sys/applemedia/vtdec.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/applemedia/corevideobuffer.c b/sys/applemedia/corevideobuffer.c
index 35faf3b8f..ed13bd1b8 100644
--- a/sys/applemedia/corevideobuffer.c
+++ b/sys/applemedia/corevideobuffer.c
@@ -102,10 +102,9 @@ gst_core_video_buffer_new (CVBufferRef cvbuf, GstVideoInfo * vinfo)
for (i = 0; i < n_planes; ++i)
stride[i] = CVPixelBufferGetBytesPerRowOfPlane (pixbuf, i);
- /* FIXME: don't hardcode NV12 */
gst_video_info_init (&tmp_vinfo);
gst_video_info_set_format (&tmp_vinfo,
- GST_VIDEO_FORMAT_NV12, stride[0], height);
+ vinfo->finfo->format, stride[0], height);
offset[1] = tmp_vinfo.offset[1];
size = tmp_vinfo.size;
} else {
@@ -124,7 +123,7 @@ gst_core_video_buffer_new (CVBufferRef cvbuf, GstVideoInfo * vinfo)
width = vinfo->width;
video_meta =
gst_buffer_add_video_meta_full (buf, GST_VIDEO_FRAME_FLAG_NONE,
- GST_VIDEO_FORMAT_NV12, width, height, n_planes, offset, stride);
+ vinfo->finfo->format, width, height, n_planes, offset, stride);
}
return buf;
diff --git a/sys/applemedia/vtdec.c b/sys/applemedia/vtdec.c
index 392c17a73..744290686 100644
--- a/sys/applemedia/vtdec.c
+++ b/sys/applemedia/vtdec.c
@@ -490,6 +490,7 @@ gst_vtdec_session_output_callback (void *decompression_output_ref_con,
GstVtdec *vtdec = (GstVtdec *) decompression_output_ref_con;
GstVideoCodecFrame *frame = (GstVideoCodecFrame *) source_frame_ref_con;
GstBuffer *buf;
+ GstVideoCodecState *state;
GST_LOG_OBJECT (vtdec, "got output frame %p %d", frame,
frame->decode_frame_number);
@@ -503,7 +504,9 @@ gst_vtdec_session_output_callback (void *decompression_output_ref_con,
goto drop;
/* FIXME: use gst_video_decoder_allocate_output_buffer */
- buf = gst_core_video_buffer_new (image_buffer, &vtdec->video_info);
+ state = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (vtdec));
+ buf = gst_core_video_buffer_new (image_buffer, &state->info);
+ gst_video_codec_state_unref (state);
frame->output_buffer = buf;
gst_buffer_copy_into (buf, frame->input_buffer,