12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- From e545f75184f9a10f1998368a227f8875cc4e907c Mon Sep 17 00:00:00 2001
- From: Felipe Contreras <felipe.contreras@nokia.com>
- Date: Mon, 28 Dec 2009 16:10:35 +0200
- Subject: [PATCH] tmp: venc: allow 'mode' backwards compatibility
- So that nobody *needs* to set it for now.
- Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
- ---
- gstdspvenc.c | 13 ++++++++++++-
- 1 files changed, 12 insertions(+), 1 deletions(-)
- diff --git a/gstdspvenc.c b/gstdspvenc.c
- index bca6fc9..0f15a06 100644
- --- a/gstdspvenc.c
- +++ b/gstdspvenc.c
- @@ -42,7 +42,7 @@ enum {
- };
-
- #define DEFAULT_BITRATE 0
- -#define DEFAULT_MODE 0
- +#define DEFAULT_MODE 2
-
- #define GST_TYPE_DSPVENC_MODE gst_dspvenc_mode_get_type()
- static GType
- @@ -54,6 +54,7 @@ gst_dspvenc_mode_get_type (void)
- static GEnumValue modes[] = {
- {0, "Storage", "storage"},
- {1, "Streaming", "streaming"},
- + {2, "Compatible", "compatible"}, /* HACK */
- {0, NULL, NULL},
- };
-
- @@ -1026,6 +1027,14 @@ sink_setcaps(GstPad *pad,
- if (gst_structure_get_int(in_struc, "height", &height))
- gst_structure_set(out_struc, "height", G_TYPE_INT, height, NULL);
-
- + /* HACK: for backwards compatibility */
- + if (self->mode == 2) {
- + if (base->alg == GSTDSP_MP4VENC)
- + self->mode = 0;
- + else
- + self->mode = 1;
- + }
- +
- switch (base->alg) {
- case GSTDSP_H263ENC:
- case GSTDSP_MP4VENC:
- @@ -1241,6 +1250,8 @@ instance_init(GTypeInstance *instance,
- gst_pad_set_setcaps_function(base->sinkpad, sink_setcaps);
-
- self->bitrate = DEFAULT_BITRATE;
- + self->mode = DEFAULT_MODE;
- +
- self->keyframe_mutex = g_mutex_new();
- }
-
|