#endif
#if 0
gst_ffmpegcsp_register (plugin);
-#endif
gst_ffmpegaudioresample_register (plugin);
+#endif
- register_protocol (&gstreamer_protocol);
- register_protocol (&gstpipe_protocol);
+ av_register_protocol2 (&gstreamer_protocol, sizeof (URLProtocol));
+ av_register_protocol2 (&gstpipe_protocol, sizeof (URLProtocol));
/* Now we can return the pointer to the newly created Plugin object. */
return TRUE;
return avcodec_default_get_buffer (context, picture);
}
+ /* FIXME, unmap me later */
+ data = gst_buffer_map (buf, &size, NULL, GST_MAP_WRITE);
+
/* copy the right pointers and strides in the picture object */
gst_ffmpeg_avpicture_fill ((AVPicture *) picture,
- GST_BUFFER_DATA (buf), context->pix_fmt, width, height);
+ data, context->pix_fmt, width, height);
break;
}
- case CODEC_TYPE_AUDIO:
+ case AVMEDIA_TYPE_AUDIO:
default:
GST_ERROR_OBJECT (ffmpegdec,
"_get_buffer() should never get called for non-video buffers !");
gint have_data = AVCODEC_MAX_AUDIO_FRAME_SIZE;
GstClockTime out_timestamp, out_duration;
gint64 out_offset;
+ int16_t *odata;
+ AVPacket *packet;
GST_DEBUG_OBJECT (ffmpegdec,
"size:%d, offset:%" G_GINT64_FORMAT ", ts:%" GST_TIME_FORMAT ", dur:%"
new_aligned_buffer (AVCODEC_MAX_AUDIO_FRAME_SIZE,
GST_PAD_CAPS (ffmpegdec->srcpad));
- len = avcodec_decode_audio2 (ffmpegdec->context, odata, &have_data,
- data, size);
+ odata = gst_buffer_map (*outbuf, NULL, NULL, GST_MAP_WRITE);
- len = avcodec_decode_audio3 (ffmpegdec->context,
- (int16_t *) GST_BUFFER_DATA (*outbuf), &have_data, packet);
++
+ packet = gst_avpacket_new (data, size);
++ len = avcodec_decode_audio3 (ffmpegdec->context, odata, &have_data, packet);
++
GST_DEBUG_OBJECT (ffmpegdec,
"Decode audio: len=%d, have_data=%d", len, have_data);