0008-tmp-venc-allow-mode-backwards-compatibility.patch 1.5 KB

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