ext/ffmpeg/gstffmpegenc.c: Add rtp-payload-size property.

Original commit message from CVS:
2005-11-28  Julien MOUTTE  <julien@moutte.net>

* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_class_init),
(gst_ffmpegenc_init), (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_setcaps), (gst_ffmpegenc_set_property),
(gst_ffmpegenc_get_property): Add rtp-payload-size property.
This commit is contained in:
Julien Moutte 2005-11-28 17:12:13 +00:00
parent 85a322a461
commit fbf165cc62
3 changed files with 33 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2005-11-28 Julien MOUTTE <julien@moutte.net>
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_class_init),
(gst_ffmpegenc_init), (gst_ffmpegenc_getcaps),
(gst_ffmpegenc_setcaps), (gst_ffmpegenc_set_property),
(gst_ffmpegenc_get_property): Add rtp-payload-size property.
2005-11-28 Tim-Philipp Müller <tim at centricular dot net> 2005-11-28 Tim-Philipp Müller <tim at centricular dot net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close), * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),

2
common

@ -1 +1 @@
Subproject commit c04ad83a0c184fcd311de39371570b9e773a60d0 Subproject commit b0b08bcd66ca385364b6f90663585b09693aec67

View file

@ -55,6 +55,7 @@ struct _GstFFMpegEnc
gint me_method; gint me_method;
gint gop_size; gint gop_size;
gulong buffer_size; gulong buffer_size;
gulong rtp_payload_size;
}; };
typedef struct _GstFFMpegEncClass GstFFMpegEncClass; typedef struct _GstFFMpegEncClass GstFFMpegEncClass;
@ -99,8 +100,9 @@ enum
ARG_BIT_RATE, ARG_BIT_RATE,
ARG_GOP_SIZE, ARG_GOP_SIZE,
ARG_ME_METHOD, ARG_ME_METHOD,
ARG_BUFSIZE ARG_BUFSIZE,
/* FILL ME */ ARG_RTP_PAYLOAD_SIZE
/* FILL ME */
}; };
#define GST_TYPE_ME_METHOD (gst_ffmpegenc_me_method_get_type()) #define GST_TYPE_ME_METHOD (gst_ffmpegenc_me_method_get_type())
@ -224,6 +226,10 @@ gst_ffmpegenc_class_init (GstFFMpegEncClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BUFSIZE, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BUFSIZE,
g_param_spec_ulong ("buffer_size", "Buffer Size", g_param_spec_ulong ("buffer_size", "Buffer Size",
"Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); "Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass),
ARG_RTP_PAYLOAD_SIZE,
g_param_spec_ulong ("rtp_payload_size", "RTP Payload Size",
"Target GOB length", 0, G_MAXULONG, 0, G_PARAM_READWRITE));
} else if (klass->in_plugin->type == CODEC_TYPE_AUDIO) { } else if (klass->in_plugin->type == CODEC_TYPE_AUDIO) {
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BIT_RATE, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BIT_RATE,
g_param_spec_ulong ("bitrate", "Bit Rate", g_param_spec_ulong ("bitrate", "Bit Rate",
@ -259,6 +265,7 @@ gst_ffmpegenc_init (GstFFMpegEnc * ffmpegenc)
ffmpegenc->bitrate = 300000; ffmpegenc->bitrate = 300000;
ffmpegenc->buffer_size = 512 * 1024; ffmpegenc->buffer_size = 512 * 1024;
ffmpegenc->gop_size = 15; ffmpegenc->gop_size = 15;
ffmpegenc->rtp_payload_size = 0;
} else if (oclass->in_plugin->type == CODEC_TYPE_AUDIO) { } else if (oclass->in_plugin->type == CODEC_TYPE_AUDIO) {
gst_pad_set_chain_function (ffmpegenc->sinkpad, gst_ffmpegenc_chain_audio); gst_pad_set_chain_function (ffmpegenc->sinkpad, gst_ffmpegenc_chain_audio);
@ -314,7 +321,7 @@ gst_ffmpegenc_getcaps (GstPad * pad)
} }
/* set some default properties */ /* set some default properties */
ctx->width = 384; ctx->width = 352;
ctx->height = 288; ctx->height = 288;
ctx->time_base.num = DEFAULT_FRAME_RATE_BASE; ctx->time_base.num = DEFAULT_FRAME_RATE_BASE;
ctx->time_base.den = 25 * DEFAULT_FRAME_RATE_BASE; ctx->time_base.den = 25 * DEFAULT_FRAME_RATE_BASE;
@ -385,6 +392,15 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
ffmpegenc->context->gop_size = ffmpegenc->gop_size; ffmpegenc->context->gop_size = ffmpegenc->gop_size;
ffmpegenc->context->me_method = ffmpegenc->me_method; ffmpegenc->context->me_method = ffmpegenc->me_method;
/* RTP payload used for GOB production (for Asterisk) */
if (ffmpegenc->rtp_payload_size) {
ffmpegenc->context->rtp_mode = 1;
ffmpegenc->context->rtp_payload_size = ffmpegenc->rtp_payload_size;
} else {
ffmpegenc->context->rtp_mode = 0;
ffmpegenc->context->rtp_payload_size = 512;
}
/* general properties */ /* general properties */
ffmpegenc->context->qmin = 1; ffmpegenc->context->qmin = 1;
ffmpegenc->context->qmax = 31; ffmpegenc->context->qmax = 31;
@ -638,6 +654,9 @@ gst_ffmpegenc_set_property (GObject * object,
case ARG_BUFSIZE: case ARG_BUFSIZE:
ffmpegenc->buffer_size = g_value_get_ulong (value); ffmpegenc->buffer_size = g_value_get_ulong (value);
break; break;
case ARG_RTP_PAYLOAD_SIZE:
ffmpegenc->rtp_payload_size = g_value_get_ulong (value);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
@ -667,6 +686,9 @@ gst_ffmpegenc_get_property (GObject * object,
case ARG_BUFSIZE: case ARG_BUFSIZE:
g_value_set_ulong (value, ffmpegenc->buffer_size); g_value_set_ulong (value, ffmpegenc->buffer_size);
break; break;
case ARG_RTP_PAYLOAD_SIZE:
g_value_set_ulong (value, ffmpegenc->rtp_payload_size);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;