mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
libav: Switch to non-deprecated symbols
This symbols/enums will all be deprecated in the next releases
This commit is contained in:
parent
70471f230f
commit
0f9cc8dac6
5 changed files with 19 additions and 20 deletions
|
@ -1865,23 +1865,23 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context,
|
|||
*/
|
||||
|
||||
static GstCaps *
|
||||
gst_ffmpeg_smpfmt_to_caps (enum SampleFormat sample_fmt,
|
||||
gst_ffmpeg_smpfmt_to_caps (enum AVSampleFormat sample_fmt,
|
||||
AVCodecContext * context, enum CodecID codec_id)
|
||||
{
|
||||
GstCaps *caps = NULL;
|
||||
GstAudioFormat format;
|
||||
|
||||
switch (sample_fmt) {
|
||||
case SAMPLE_FMT_S16:
|
||||
case AV_SAMPLE_FMT_S16:
|
||||
format = GST_AUDIO_FORMAT_S16;
|
||||
break;
|
||||
case SAMPLE_FMT_S32:
|
||||
case AV_SAMPLE_FMT_S32:
|
||||
format = GST_AUDIO_FORMAT_S32;
|
||||
break;
|
||||
case SAMPLE_FMT_FLT:
|
||||
case AV_SAMPLE_FMT_FLT:
|
||||
format = GST_AUDIO_FORMAT_F32;
|
||||
break;
|
||||
case SAMPLE_FMT_DBL:
|
||||
case AV_SAMPLE_FMT_DBL:
|
||||
format = GST_AUDIO_FORMAT_F64;
|
||||
break;
|
||||
default:
|
||||
|
@ -1930,12 +1930,12 @@ gst_ffmpeg_codectype_to_audio_caps (AVCodecContext * context,
|
|||
}
|
||||
} else {
|
||||
GstCaps *temp;
|
||||
enum SampleFormat i;
|
||||
enum AVSampleFormat i;
|
||||
AVCodecContext ctx = { 0, };
|
||||
|
||||
ctx.channels = -1;
|
||||
caps = gst_caps_new_empty ();
|
||||
for (i = 0; i <= SAMPLE_FMT_DBL; i++) {
|
||||
for (i = 0; i <= AV_SAMPLE_FMT_DBL; i++) {
|
||||
temp = gst_ffmpeg_smpfmt_to_caps (i, encode ? &ctx : NULL, codec_id);
|
||||
if (temp != NULL) {
|
||||
gst_caps_append (caps, temp);
|
||||
|
@ -2038,16 +2038,16 @@ gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps,
|
|||
|
||||
switch (format) {
|
||||
case GST_AUDIO_FORMAT_F32:
|
||||
context->sample_fmt = SAMPLE_FMT_FLT;
|
||||
context->sample_fmt = AV_SAMPLE_FMT_FLT;
|
||||
break;
|
||||
case GST_AUDIO_FORMAT_F64:
|
||||
context->sample_fmt = SAMPLE_FMT_DBL;
|
||||
context->sample_fmt = AV_SAMPLE_FMT_DBL;
|
||||
break;
|
||||
case GST_AUDIO_FORMAT_S32:
|
||||
context->sample_fmt = SAMPLE_FMT_S32;
|
||||
context->sample_fmt = AV_SAMPLE_FMT_S32;
|
||||
break;
|
||||
case GST_AUDIO_FORMAT_S16:
|
||||
context->sample_fmt = SAMPLE_FMT_S16;
|
||||
context->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -39,21 +39,21 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
|
|||
}
|
||||
|
||||
gint
|
||||
av_smp_format_depth (enum SampleFormat smp_fmt)
|
||||
av_smp_format_depth (enum AVSampleFormat smp_fmt)
|
||||
{
|
||||
gint depth = -1;
|
||||
switch (smp_fmt) {
|
||||
case SAMPLE_FMT_U8:
|
||||
case AV_SAMPLE_FMT_U8:
|
||||
depth = 1;
|
||||
break;
|
||||
case SAMPLE_FMT_S16:
|
||||
case AV_SAMPLE_FMT_S16:
|
||||
depth = 2;
|
||||
break;
|
||||
case SAMPLE_FMT_S32:
|
||||
case SAMPLE_FMT_FLT:
|
||||
case AV_SAMPLE_FMT_S32:
|
||||
case AV_SAMPLE_FMT_FLT:
|
||||
depth = 4;
|
||||
break;
|
||||
case SAMPLE_FMT_DBL:
|
||||
case AV_SAMPLE_FMT_DBL:
|
||||
depth = 8;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -89,7 +89,7 @@ G_CONST_RETURN gchar *
|
|||
gst_ffmpeg_get_codecid_longname (enum CodecID codec_id);
|
||||
|
||||
gint
|
||||
av_smp_format_depth(enum SampleFormat smp_fmt);
|
||||
av_smp_format_depth(enum AVSampleFormat smp_fmt);
|
||||
|
||||
GstBuffer *
|
||||
new_aligned_buffer (gint size);
|
||||
|
|
|
@ -606,7 +606,6 @@ gst_ffmpegviddec_get_buffer (AVCodecContext * context, AVFrame * picture)
|
|||
/* tell ffmpeg we own this buffer, tranfer the ref we have on the buffer to
|
||||
* the opaque data. */
|
||||
picture->type = FF_BUFFER_TYPE_USER;
|
||||
picture->age = 256 * 256 * 256 * 64;
|
||||
|
||||
GST_LOG_OBJECT (ffmpegdec, "returned frame %p", frame->output_buffer);
|
||||
|
||||
|
|
|
@ -662,7 +662,7 @@ gst_ffmpegvidenc_handle_frame (GstVideoEncoder * encoder,
|
|||
GstVideoFrame vframe;
|
||||
|
||||
if (GST_VIDEO_CODEC_FRAME_IS_FORCE_KEYFRAME (frame))
|
||||
ffmpegenc->picture->pict_type = FF_I_TYPE;
|
||||
ffmpegenc->picture->pict_type = AV_PICTURE_TYPE_I;
|
||||
|
||||
if (!gst_video_frame_map (&vframe, info, frame->input_buffer, GST_MAP_READ)) {
|
||||
GST_ERROR_OBJECT (encoder, "Failed to map input buffer");
|
||||
|
|
Loading…
Reference in a new issue