recipes-multimedia: add gstreamer-0.10 recipes

So that they can be removed from oe-core
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6294

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Alexander Kanavin 2015-05-18 17:12:47 +03:00 committed by Martin Jansa
parent 2b79eeb404
commit 175406cdca
68 changed files with 12815 additions and 0 deletions

View File

@ -0,0 +1,34 @@
gst-ffmpeg: aacdec: check channel count
Prevent out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 96f452ac647dae33c53c242ef3266b65a9beafb6)
Upstream-Status: Backport
Signed-off-by: Yue Tao <yue.tao@windriver.com>
---
libavcodec/aacdec.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 239153a..6c17c33 100644
--- a/gst-libs/ext/libav/libavcodec/aacdec.c
+++ b/gst-libs/ext/libav/libavcodec/aacdec.c
@@ -914,6 +914,11 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
}
}
+ if (avctx->channels > MAX_CHANNELS) {
+ av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
+ return AVERROR_INVALIDDATA;
+ }
+
AAC_INIT_VLC_STATIC( 0, 304);
AAC_INIT_VLC_STATIC( 1, 270);
AAC_INIT_VLC_STATIC( 2, 550);
--
1.7.5.4

View File

@ -0,0 +1,30 @@
From e0884eadf6a15e93142131b695f48776f9a0ac31 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sat, 10 Nov 2012 17:14:04 +0100
Subject: [PATCH] alac: fix nb_samples < order case
Upstream-Status: Backport
Commit e0884eadf6a15e93142131b695f48776f9a0ac31 release/1.0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fd4f4923cce6a2cbf4f48640b4ac706e614a1594)
---
libavcodec/alac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 9cd1737..e8e844a 100644
--- a/gst-libs/ext/libav/libavcodec/alac.c
+++ b/gst-libs/ext/libav/libavcodec/alac.c
@@ -278,7 +278,7 @@ static void predictor_decompress_fir_ada
/* read warm-up samples */
if (predictor_coef_num > 0)
- for (i = 0; i < predictor_coef_num; i++) {
+ for (i = 0; i < predictor_coef_num && i < output_size; i++) {
int32_t val;
val = buffer_out[i] + error_buffer[i+1];
--

View File

@ -0,0 +1,61 @@
From 6df0d3e2916c223dbe4262bf1b876dff1cb3f980 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Wed, 12 Dec 2012 12:28:45 +0100
Subject: [PATCH] alsdec: check block length
Upstream-Status: Backport
Commit 6df0d3e2916c223dbe4262bf1b876dff1cb3f980 release/1.0
Fix writing over the end
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0ceca269b66ec12a23bf0907bd2c220513cdbf16)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/alsdec.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 46dd0b4..1095b01 100644
--- a/gst-libs/ext/libav/libavcodec/alsdec.c
+++ b/gst-libs/ext/libav/libavcodec/alsdec.c
@@ -552,12 +552,15 @@ static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks,
/** Read the block data for a constant block
*/
-static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
+static int read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
{
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
GetBitContext *gb = &ctx->gb;
+ if (bd->block_length <= 0)
+ return -1;
+
*bd->raw_samples = 0;
*bd->const_block = get_bits1(gb); // 1 = constant value, 0 = zero block (silence)
bd->js_blocks = get_bits1(gb);
@@ -572,6 +575,8 @@ static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
// ensure constant block decoding by reusing this field
*bd->const_block = 1;
+
+ return 0;
}
@@ -971,7 +976,8 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
if (read_var_block_data(ctx, bd))
return -1;
} else {
- read_const_block_data(ctx, bd);
+ if (read_const_block_data(ctx, bd) < 0)
+ return -1;
}
return 0;
--

View File

@ -0,0 +1,37 @@
From 2502914c5f8eb77659d7c0868396862557a63245 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Fri, 9 Nov 2012 13:26:20 +0100
Subject: [PATCH] atrac3dec: Check coding mode against channels.
Upstream-Status: Backport
Commit 2502914c5f8eb77659d7c0868396862557a63245 release/1.0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 13451f5520ce6b0afde861b2285dda659f8d4fb4)
Conflicts:
libavcodec/atrac3.c
---
libavcodec/atrac3.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 7d076be..1da4c78 100644
--- a/gst-libs/ext/libav/libavcodec/atrac3.c
+++ b/gst-libs/ext/libav/libavcodec/atrac3.c
@@ -955,6 +955,11 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
}
/* Check the extradata. */
+ if (q->codingMode == JOINT_STEREO && avctx->channels < 2) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid coding mode\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (q->atrac3version != 4) {
av_log(avctx,AV_LOG_ERROR,"Version %d != 4.\n",q->atrac3version);
return AVERROR_INVALIDDATA;
--

View File

@ -0,0 +1,40 @@
From a99aff4e4bbef8e64b51f267cd1769214e1b4e80 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Fri, 30 Aug 2013 23:40:47 +0200
Subject: [PATCH] avcodec/dsputil: fix signedness in sizeof() comparissions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 454a11a1c9c686c78aa97954306fb63453299760)
Upstream-Status: Backport
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/dsputil.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 53dc2eb..6264832 100644
--- a/gst-libs/ext/libav/libavcodec/dsputil.c
+++ b/gst-libs/ext/libav/libavcodec/dsputil.c
@@ -1912,7 +1912,7 @@ void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type){
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
long i;
- for(i=0; i<=w-sizeof(long); i+=sizeof(long)){
+ for(i=0; i<=w-(int)sizeof(long); i+=sizeof(long)){
long a = *(long*)(src+i);
long b = *(long*)(dst+i);
*(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80);
@@ -1937,7 +1937,7 @@ static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
}
}else
#endif
- for(i=0; i<=w-sizeof(long); i+=sizeof(long)){
+ for(i=0; i<=w-(int)sizeof(long); i+=sizeof(long)){
long a = *(long*)(src1+i);
long b = *(long*)(src2+i);
*(long*)(dst+i) = ((a|pb_80) - (b&pb_7f)) ^ ((a^b^pb_80)&pb_80);
--
1.7.5.4

View File

@ -0,0 +1,50 @@
From 573d5fdedae72bf59d8c0b0766fdee171063d36f Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sun, 16 Feb 2014 23:08:52 +0100
Subject: [PATCH] avcodec/msrle: use av_image_get_linesize() to calculate the
linesize
Upstream-Status: Backport
Commit 573d5fdedae72bf59d8c0b0766fdee171063d36f release/0.9
Fixes out of array access
Fixes: 14a74a0a2dc67ede543f0e35d834fbbe-asan_heap-oob_49572c_556_cov_215466444_44_001_engine_room.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c919e1ca2ecfc47d796382973ba0e48b8f6f92a2)
Conflicts:
libavcodec/msrle.c
(cherry picked from commit bc1c8ec5e65098fd2ccd8456f667151dfc9cda42)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/msrle.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index 30159bb..c39ae7b 100644
--- a/gst-libs/ext/libav/libavcodec/msrle.c
+++ b/gst-libs/ext/libav/libavcodec/msrle.c
@@ -35,6 +35,7 @@
#include "avcodec.h"
#include "dsputil.h"
#include "msrledec.h"
+#include "libavutil/imgutils.h"
typedef struct MsrleContext {
AVCodecContext *avctx;
@@ -107,7 +108,7 @@ static int msrle_decode_frame(AVCodecContext *avctx,
/* FIXME how to correctly detect RLE ??? */
if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
- int linesize = avctx->width * avctx->bits_per_coded_sample / 8;
+ int linesize = av_image_get_linesize(avctx->pix_fmt, avctx->width, 0);
uint8_t *ptr = s->frame.data[0];
uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
int i, j;
--
1.7.5.4

View File

@ -0,0 +1,50 @@
gst-ffmpeg: avcodec/parser: reset indexes on realloc failure
Fixes Ticket2982
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f31011e9abfb2ae75bb32bc44e2c34194c8dc40a)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Upstream-Status: Backport
Signed-off-by: Yue Tao <yue.tao@windriver.com>
---
libavcodec/parser.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 2c6de6e..66eca06 100644
--- a/gst-libs/ext/libav/libavcodec/parser.c
+++ b/gst-libs/ext/libav/libavcodec/parser.c
@@ -241,8 +241,10 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s
if(next == END_NOT_FOUND){
void* new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size, (*buf_size) + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
- if(!new_buffer)
+ if(!new_buffer) {
+ pc->index = 0;
return AVERROR(ENOMEM);
+ }
pc->buffer = new_buffer;
memcpy(&pc->buffer[pc->index], *buf, *buf_size);
pc->index += *buf_size;
@@ -255,9 +257,11 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s
/* append to buffer */
if(pc->index){
void* new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size, next + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
-
- if(!new_buffer)
+ if(!new_buffer) {
+ pc->overread_index =
+ pc->index = 0;
return AVERROR(ENOMEM);
+ }
pc->buffer = new_buffer;
if (next > -FF_INPUT_BUFFER_PADDING_SIZE)
memcpy(&pc->buffer[pc->index], *buf,
--
1.7.5.4

View File

@ -0,0 +1,81 @@
gst-ffmpeg: avcodec/rpza: Perform pointer advance and checks before
using the pointers
Fixes out of array accesses
Fixes Ticket2850
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3819db745da2ac7fb3faacb116788c32f4753f34)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Upstream-Status: Backport
Singed-off-by: Yue Tao <yue.tao@windriver.com>
---
libavcodec/rpza.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index 635b406..f291a95 100644
--- a/gst-libs/ext/libav/libavcodec/rpza.c
+++ b/gst-libs/ext/libav/libavcodec/rpza.c
@@ -83,7 +83,7 @@ static void rpza_decode_stream(RpzaContext *s)
unsigned short *pixels = (unsigned short *)s->frame.data[0];
int row_ptr = 0;
- int pixel_ptr = 0;
+ int pixel_ptr = -4;
int block_ptr;
int pixel_x, pixel_y;
int total_blocks;
@@ -139,6 +139,7 @@ static void rpza_decode_stream(RpzaContext *s)
colorA = AV_RB16 (&s->buf[stream_ptr]);
stream_ptr += 2;
while (n_blocks--) {
+ ADVANCE_BLOCK()
block_ptr = row_ptr + pixel_ptr;
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
for (pixel_x = 0; pixel_x < 4; pixel_x++){
@@ -147,7 +148,6 @@ static void rpza_decode_stream(RpzaContext *s)
}
block_ptr += row_inc;
}
- ADVANCE_BLOCK();
}
break;
@@ -184,6 +184,7 @@ static void rpza_decode_stream(RpzaContext *s)
color4[2] |= ((21 * ta + 11 * tb) >> 5);
while (n_blocks--) {
+ ADVANCE_BLOCK();
block_ptr = row_ptr + pixel_ptr;
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
index = s->buf[stream_ptr++];
@@ -194,12 +195,12 @@ static void rpza_decode_stream(RpzaContext *s)
}
block_ptr += row_inc;
}
- ADVANCE_BLOCK();
}
break;
/* Fill block with 16 colors */
case 0x00:
+ ADVANCE_BLOCK();
block_ptr = row_ptr + pixel_ptr;
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
for (pixel_x = 0; pixel_x < 4; pixel_x++){
@@ -213,7 +214,6 @@ static void rpza_decode_stream(RpzaContext *s)
}
block_ptr += row_inc;
}
- ADVANCE_BLOCK();
break;
/* Unknown opcode */
--
1.7.5.4

View File

@ -0,0 +1,32 @@
From c17a0ad1df15a94d0b1239adc2afb593bdf0a153 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Fri, 3 Oct 2014 22:50:45 +0200
Subject: [PATCH 1/2] avcodec/smc: fix off by 1 error
Upstream-Status: Backport
Fixes out of array access
Fixes: asan_heap-oob_1685bf0_5_asan_heap-oob_1f35116_430_smc.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/smc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gst-libs/ext/libav/libavcodec/smc.c b/gst-libs/ext/libav/libavcodec/smc.c
index 3cd5e53..dec9f71 100644
--- a/gst-libs/ext/libav/libavcodec/smc.c
+++ b/gst-libs/ext/libav/libavcodec/smc.c
@@ -69,7 +69,7 @@ typedef struct SmcContext {
row_ptr += stride * 4; \
} \
total_blocks--; \
- if (total_blocks < 0) \
+ if (total_blocks < 0 + !!n_blocks) \
{ \
av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
return; \
--
2.1.0

View File

@ -0,0 +1,69 @@
From 12770701856a05b6b3cd706f708f8e9a4e8a1336 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Thu, 13 Feb 2014 13:59:51 +0100
Subject: [PATCH] avformat/mpegtsenc: Check data array size in
mpegts_write_pmt()
Upstream-Status: Backport
COmmit 12770701856a05b6b3cd706f708f8e9a4e8a1336 release/0.11
Prevents out of array writes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 842b6c14bcfc1c5da1a2d288fd65386eb8c158ad)
Conflicts:
libavformat/mpegtsenc.c
(cherry picked from commit e87de3f50b765134588d0b048c32ed4b8acc16fb)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavformat/mpegtsenc.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 793e205..a12d19f 100644
--- a/gst-libs/ext/libav/libavformat/mpegtsenc.c
+++ b/gst-libs/ext/libav/libavformat/mpegtsenc.c
@@ -240,7 +240,7 @@ static void mpegts_write_pat(AVFormatContext *s)
data, q - data);
}
-static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
+static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
{
// MpegTSWrite *ts = s->priv_data;
uint8_t data[1012], *q, *desc_length_ptr, *program_info_length_ptr;
@@ -293,6 +293,10 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
stream_type = STREAM_TYPE_PRIVATE_DATA;
break;
}
+
+ if (q - data > sizeof(data) - 32)
+ return AVERROR(EINVAL);
+
*q++ = stream_type;
put16(&q, 0xe000 | ts_st->pid);
desc_length_ptr = q;
@@ -324,7 +328,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
len_ptr = q++;
*len_ptr = 0;
- for (p = lang->value; next && *len_ptr < 255 / 4 * 4; p = next + 1) {
+ for (p = lang->value; next && *len_ptr < 255 / 4 * 4 && q - data < sizeof(data) - 4; p = next + 1) {
next = strchr(p, ',');
if (strlen(p) != 3 && (!next || next != p + 3))
continue; /* not a 3-letter code */
@@ -386,6 +390,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
}
mpegts_write_section1(&service->pmt, PMT_TID, service->sid, 0, 0, 0,
data, q - data);
+ return 0;
}
/* NOTE: str == NULL is accepted for an empty string */
--
1.7.5.4

View File

@ -0,0 +1,29 @@
From 63ac64864c6e0e84355aa3caa5b92208997a9a8d Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sat, 17 Nov 2012 16:26:55 +0100
Subject: [PATCH] eamad: fix out of array accesses
Upstream-Status: Backport
Commit 63ac64864c6e0e84355aa3caa5b92208997a9a8d release/1.1
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/eamad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 2805195..e38650e 100644
--- a/gst-libs/ext/libav/libavcodec/eamad.c
+++ b/gst-libs/ext/libav/libavcodec/eamad.c
@@ -237,7 +237,7 @@ static int decode_frame(AVCodecContext *avctx,
int chunk_type;
int inter;
- if (buf_size < 17) {
+ if (buf_size < 26) {
av_log(avctx, AV_LOG_ERROR, "Input buffer too small\n");
*data_size = 0;
return -1;
--

View File

@ -0,0 +1,29 @@
gst-ffmpeg: error concealment: initialize block index.
Fixes CVE-2011-3941 (out of bounds write)
Upstream-Status: Backport
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/error_resilience.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 8bb5d0c..d55c000 100644
--- a/gst-libs/ext/libav/libavcodec/error_resilience.c
+++ b/gst-libs/ext/libav/libavcodec/error_resilience.c
@@ -45,6 +45,9 @@ static void decode_mb(MpegEncContext *s, int ref){
s->dest[1] = s->current_picture.data[1] + (s->mb_y * (16>>s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16>>s->chroma_x_shift);
s->dest[2] = s->current_picture.data[2] + (s->mb_y * (16>>s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16>>s->chroma_x_shift);
+ ff_init_block_index(s);
+ ff_update_block_index(s);
+
if(CONFIG_H264_DECODER && s->codec_id == CODEC_ID_H264){
H264Context *h= (void*)s;
h->mb_xy= s->mb_x + s->mb_y*s->mb_stride;
--
1.7.5.4

View File

@ -0,0 +1,37 @@
gst-ffmpeg: error_concealment: Check that the picture is not in a half
Fixes state becoming inconsistent
Fixes a null pointer dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 23318a57358358e7a4dc551e830e4503f0638cfe)
Upstream-Status: Backport
Signed-off-by: Yue Tao <yue.tao@windriver.com>
---
libavcodec/error_resilience.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 01f7424..2b6bc42 100644
--- a/gst-libs/ext/libav/libavcodec/error_resilience.c
+++ b/gst-libs/ext/libav/libavcodec/error_resilience.c
@@ -793,6 +793,12 @@ void ff_er_frame_end(MpegEncContext *s){
s->picture_structure != PICT_FRAME || // we dont support ER of field pictures yet, though it should not crash if enabled
s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
+ if ( s->picture_structure == PICT_FRAME
+ && s->current_picture.linesize[0] != s->current_picture_ptr->linesize[0]) {
+ av_log(s->avctx, AV_LOG_ERROR, "Error concealment not possible, frame not fully initialized\n");
+ return;
+ }
+
if(s->current_picture.motion_val[0] == NULL){
av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
--
1.7.5.4

View File

@ -0,0 +1,36 @@
gst-ffmpeg: ffserver: set oformat
Fix Ticket1986
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cbe43e62c9ac7d4aefdc13476f6f691bd626525f)
Upstream-Status: Backport
---
ffserver.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/ffserver.c b/ffserver.c
index 4044d0f..8740140 100644
--- a/gst-libs/ext/libav/ffserver.c
+++ b/gst-libs/ext/libav/ffserver.c
@@ -2937,12 +2937,14 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
{
AVFormatContext *avc;
AVStream *avs = NULL;
+ AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
int i;
avc = avformat_alloc_context();
- if (avc == NULL) {
+ if (avc == NULL || !rtp_format) {
return -1;
}
+ avc->oformat = rtp_format;
av_dict_set(&avc->metadata, "title",
stream->title[0] ? stream->title : "No Title", 0);
avc->nb_streams = stream->nb_streams;
--
1.7.5.4

View File

@ -0,0 +1,29 @@
From d6c184880ee2e09fd68c0ae217173832cee5afc1 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sun, 18 Nov 2012 16:29:04 +0100
Subject: [PATCH] h264: correct ref count check and limit, fix out of array
accesses.
Upstream-Status: Backport
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/h264.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index da43f1e..32cede5 100644
--- a/gst-libs/ext/libav/libavcodec/h264.c
+++ b/gst-libs/ext/libav/libavcodec/h264.c
@@ -2870,6 +2870,9 @@ static int decode_slice_header(H264Conte
h->ref_count[0]= get_ue_golomb(&s->gb) + 1;
if(h->slice_type_nos==AV_PICTURE_TYPE_B)
h->ref_count[1]= get_ue_golomb(&s->gb) + 1;
+ else
+ // full range is spec-ok in this case, even for frames
+ h->ref_count[1] = 1;
if(h->ref_count[0]-1 > 32-1 || h->ref_count[1]-1 > 32-1){
av_log(h->s.avctx, AV_LOG_ERROR, "reference overflow\n");
--

View File

@ -0,0 +1,145 @@
gst-ffmpeg: h264: set parameters from SPS whenever it changes
Fixes a crash in the fuzzed sample sample_varPAR.avi_s26638 with
alternating bit depths.
Upstream-Status: Backport
Signed-off-by: Yue Tao <yue.tao@windriver.com>
diff --git a/gst-libs/ext/libav/libavcodec/h264.c.old b/gst-libs/ext/libav/libavcodec/h264.c
index 3621f41..718906a 100644
--- a/gst-libs/ext/libav/libavcodec/h264.c.old
+++ b/gst-libs/ext/libav/libavcodec/h264.c
@@ -2491,6 +2491,34 @@ int ff_h264_get_profile(SPS *sps)
return profile;
}
+static int h264_set_parameter_from_sps(H264Context *h)
+{
+ MpegEncContext *s = &h->s;
+ AVCodecContext * avctx= s->avctx;
+
+ if (s->flags& CODEC_FLAG_LOW_DELAY ||
+ (h->sps.bitstream_restriction_flag && !h->sps.num_reorder_frames))
+ s->low_delay=1;
+
+ if(avctx->has_b_frames < 2)
+ avctx->has_b_frames= !s->low_delay;
+
+ if (avctx->bits_per_raw_sample != h->sps.bit_depth_luma) {
+ if (h->sps.bit_depth_luma >= 8 && h->sps.bit_depth_luma <= 10) {
+ avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
+ h->pixel_shift = h->sps.bit_depth_luma > 8;
+
+ ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma);
+ ff_h264_pred_init(&h->hpc, s->codec_id, h->sps.bit_depth_luma);
+ dsputil_init(&s->dsp, s->avctx);
+ } else {
+ av_log(avctx, AV_LOG_DEBUG, "Unsupported bit depth: %d\n", h->sps.bit_depth_luma);
+ return -1;
+ }
+ }
+ return 0;
+}
+
/**
* decodes a slice header.
* This will also call MPV_common_init() and frame_start() as needed.
@@ -2505,7 +2533,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
MpegEncContext * const s0 = &h0->s;
unsigned int first_mb_in_slice;
unsigned int pps_id;
- int num_ref_idx_active_override_flag;
+ int num_ref_idx_active_override_flag, ret;
unsigned int slice_type, tmp, i, j;
int default_ref_list_done = 0;
int last_pic_structure;
@@ -2569,7 +2597,17 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
av_log(h->s.avctx, AV_LOG_ERROR, "non-existing SPS %u referenced\n", h->pps.sps_id);
return -1;
}
- h->sps = *h0->sps_buffers[h->pps.sps_id];
+
+ if (h->pps.sps_id != h->current_sps_id ||
+ h0->sps_buffers[h->pps.sps_id]->new) {
+ h0->sps_buffers[h->pps.sps_id]->new = 0;
+
+ h->current_sps_id = h->pps.sps_id;
+ h->sps = *h0->sps_buffers[h->pps.sps_id];
+
+ if ((ret = h264_set_parameter_from_sps(h)) < 0)
+ return ret;
+ }
s->avctx->profile = ff_h264_get_profile(&h->sps);
s->avctx->level = h->sps.level_idc;
@@ -3811,26 +3811,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
case NAL_SPS:
init_get_bits(&s->gb, ptr, bit_length);
ff_h264_decode_seq_parameter_set(h);
-
- if (s->flags& CODEC_FLAG_LOW_DELAY ||
- (h->sps.bitstream_restriction_flag && !h->sps.num_reorder_frames))
- s->low_delay=1;
-
- if(avctx->has_b_frames < 2)
- avctx->has_b_frames= !s->low_delay;
-
- if (avctx->bits_per_raw_sample != h->sps.bit_depth_luma) {
- if (h->sps.bit_depth_luma >= 8 && h->sps.bit_depth_luma <= 10) {
- avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
- h->pixel_shift = h->sps.bit_depth_luma > 8;
-
- ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma);
- ff_h264_pred_init(&h->hpc, s->codec_id, h->sps.bit_depth_luma);
- dsputil_init(&s->dsp, s->avctx);
- } else {
- av_log(avctx, AV_LOG_DEBUG, "Unsupported bit depth: %d\n", h->sps.bit_depth_luma);
- return -1;
- }
+ if (h264_set_parameter_from_sps(h) < 0) {
+ return -1;
}
break;
case NAL_PPS:
diff --git a/gst-libs/ext/libav/libavcodec/h264.h.old b/gst-libs/ext/libav/libavcodec/h264.h
index e3cc815..b77ad98 100644
--- a/gst-libs/ext/libav/libavcodec/h264.h.old
+++ b/gst-libs/ext/libav/libavcodec/h264.h
@@ -202,6 +202,7 @@ typedef struct SPS{
int bit_depth_chroma; ///< bit_depth_chroma_minus8 + 8
int residual_color_transform_flag; ///< residual_colour_transform_flag
int constraint_set_flags; ///< constraint_set[0-3]_flag
+ int new; ///< flag to keep track if the decoder context needs re-init due to changed SPS
}SPS;
/**
@@ -333,6 +334,7 @@ typedef struct H264Context{
int emu_edge_width;
int emu_edge_height;
+ unsigned current_sps_id; ///< id of the current SPS
SPS sps; ///< current sps
/**
diff --git a/gst-libs/ext/libav/libavcodec/h264_ps.c.old b/gst-libs/ext/libav/libavcodec/h264_ps.c
index 7491807..0929098 100644
--- a/gst-libs/ext/libav/libavcodec/h264_ps.c.old
+++ b/gst-libs/ext/libav/libavcodec/h264_ps.c
@@ -438,10 +438,13 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
sps->timing_info_present_flag ? sps->time_scale : 0
);
}
+ sps->new = 1;
av_free(h->sps_buffers[sps_id]);
- h->sps_buffers[sps_id]= sps;
- h->sps = *sps;
+ h->sps_buffers[sps_id] = sps;
+ h->sps = *sps;
+ h->current_sps_id = sps_id;
+
return 0;
fail:
av_free(sps);

View File

@ -0,0 +1,33 @@
gst-ffmpeg: h264: skip error concealment when SPS and slices are
mismatching
Fixes out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 695af8eed642ff0104834495652d1ee784a4c14d)
Upstream-Status: Backport
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Yue Tao <yue.tao@windriver.com>
---
libavcodec/h264.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index da144db..0aab4e7 100644
--- a/gst-libs/ext/libav/libavcodec/h264.c
+++ b/gst-libs/ext/libav/libavcodec/h264.c
@@ -2351,7 +2351,7 @@ static int field_end(H264Context *h, int in_setup)
* past end by one (callers fault) and resync_mb_y != 0
* causes problems for the first MB line, too.
*/
- if (!FIELD_PICTURE)
+ if (!FIELD_PICTURE && h->current_slice && !h->sps.new)
ff_er_frame_end(s);
ff_MPV_frame_end(s);
--
1.7.5.4

View File

@ -0,0 +1,39 @@
gst-ffmpeg: h264_sei: Fix infinite loop.
Fixsot yet fixed parts of CVE-2011-3946.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Upstream-Status: Backport
Signed-off-by: Yue Tao <yue.tao@windriver.com>
---
libavcodec/h264_sei.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index 374e53d..80d70e5 100644
--- a/gst-libs/ext/libav/libavcodec/h264_sei.c
+++ b/gst-libs/ext/libav/libavcodec/h264_sei.c
@@ -169,11 +169,15 @@ int ff_h264_decode_sei(H264Context *h){
type=0;
do{
+ if (get_bits_left(&s->gb) < 8)
+ return -1;
type+= show_bits(&s->gb, 8);
}while(get_bits(&s->gb, 8) == 255);
size=0;
do{
+ if (get_bits_left(&s->gb) < 8)
+ return -1;
size+= show_bits(&s->gb, 8);
}while(get_bits(&s->gb, 8) == 255);
--
1.7.5.4

View File

@ -0,0 +1,87 @@
From b666debffec1fcbb19ef377635a53b9a58bca8a4 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Tue, 29 Jan 2013 18:29:41 +0100
Subject: [PATCH] huffyuvdec: Check init_vlc() return codes.
Upstream-Status: Backport
Commit b666debffec1fcbb19ef377635a53b9a58bca8a4 release/1.0
Prevents out of array writes
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f67a0d115254461649470452058fa3c28c0df294)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/huffyuv.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c
index 58da789..993e524 100644
--- a/gst-libs/ext/libav/libavcodec/huffyuv.c
+++ b/gst-libs/ext/libav/libavcodec/huffyuv.c
@@ -33,6 +33,7 @@
#include "put_bits.h"
#include "dsputil.h"
#include "thread.h"
+#include "libavutil/avassert.h"
#define VLC_BITS 11
@@ -287,6 +287,7 @@ static void generate_joint_tables(HYuvCo
int len1 = s->len[p][u];
if (len1 > limit || !len1)
continue;
+ av_assert0(i < (1 << VLC_BITS));
len[i] = len0 + len1;
bits[i] = (s->bits[0][y] << len1) + s->bits[p][u];
symbols[i] = (y<<8) + u;
@@ -320,6 +321,7 @@ static void generate_joint_tables(HYuvCo
int len2 = s->len[2][r&255];
if (len2 > limit1 || !len2)
continue;
+ av_assert0(i < (1 << VLC_BITS));
len[i] = len0 + len1 + len2;
bits[i] = (code << len2) + s->bits[2][r&255];
if(s->decorrelate){
@@ -343,6 +345,7 @@ static void generate_joint_tables(HYuvCo
static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){
GetBitContext gb;
int i;
+ int ret;
init_get_bits(&gb, src, length*8);
@@ -353,7 +356,9 @@ static int read_huffman_tables(HYuvConte
return -1;
}
free_vlc(&s->vlc[i]);
- init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
+ if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
+ s->bits[i], 4, 4, 0)) < 0)
+ return ret;
}
generate_joint_tables(s);
@@ -365,6 +370,7 @@ static int read_old_huffman_tables(HYuvC
#if 1
GetBitContext gb;
int i;
+ int ret;
init_get_bits(&gb, classic_shift_luma, sizeof(classic_shift_luma)*8);
if(read_len_table(s->len[0], &gb)<0)
@@ -385,7 +391,9 @@ static int read_old_huffman_tables(HYuvC
for(i=0; i<3; i++){
free_vlc(&s->vlc[i]);
- init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
+ if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
+ s->bits[i], 4, 4, 0)) < 0)
+ return ret;
}
generate_joint_tables(s);
--

View File

@ -0,0 +1,61 @@
From db0f7f7394e1f994ed38db043f78ed0f10bde0da Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Tue, 29 Jan 2013 19:22:33 +0100
Subject: [PATCH] huffyuvdec: Skip len==0 cases
Upstream-Status: Backport
Commit db0f7f7394e1f994ed38db043f78ed0f10bde0da release/1.0
Fixes vlc decoding for hypothetical files that would contain such cases.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0dfc01c2bbf4b71bb56201bc4a393321e15d1b31)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/huffyuv.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c
index 993e524..72ed351 100644
--- a/gst-libs/ext/libav/libavcodec/huffyuv.c
+++ b/gst-libs/ext/libav/libavcodec/huffyuv.c
@@ -281,11 +281,11 @@ static void generate_joint_tables(HYuvCo
for(i=y=0; y<256; y++){
int len0 = s->len[0][y];
int limit = VLC_BITS - len0;
- if(limit <= 0)
+ if(limit <= 0 || !len0)
continue;
for(u=0; u<256; u++){
int len1 = s->len[p][u];
- if(len1 > limit)
+ if (len1 > limit || !len1)
continue;
len[i] = len0 + len1;
bits[i] = (s->bits[0][y] << len1) + s->bits[p][u];
@@ -308,17 +308,17 @@ static void generate_joint_tables(HYuvCo
for(i=0, g=-16; g<16; g++){
int len0 = s->len[p0][g&255];
int limit0 = VLC_BITS - len0;
- if(limit0 < 2)
+ if (limit0 < 2 || !len0)
continue;
for(b=-16; b<16; b++){
int len1 = s->len[p1][b&255];
int limit1 = limit0 - len1;
- if(limit1 < 1)
+ if (limit1 < 1 || !len1)
continue;
code = (s->bits[p0][g&255] << len1) + s->bits[p1][b&255];
for(r=-16; r<16; r++){
int len2 = s->len[2][r&255];
- if(len2 > limit1)
+ if (len2 > limit1 || !len2)
continue;
len[i] = len0 + len1 + len2;
bits[i] = (code << len2) + s->bits[2][r&255];
--
1.8.5.2.233.g932f7e4

View File

@ -0,0 +1,45 @@
gst-ffmpeg: lavf: compute probe buffer size more reliably.
The previous code computes the offset by reversing the growth
of the allocated buffer size: it is complex and did lead to
inconsistencies when the size limit is reached.
Fix trac ticket #1991.
(cherry picked from commit 03847eb8259291b4ff1bd840bd779d0699d71f96)
Conflicts:
libavformat/utils.c
Upstream-Status: Backport
Signed-off-by: Yue Tao <yue.tao@windriver.com>
---
libavformat/utils.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 7940037..be73c4a 100644
--- a/gst-libs/ext/libav/libavformat/utils.c
+++ b/gst-libs/ext/libav/libavformat/utils.c
@@ -459,7 +459,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
{
AVProbeData pd = { filename ? filename : "", NULL, -offset };
unsigned char *buf = NULL;
- int ret = 0, probe_size;
+ int ret = 0, probe_size, buf_offset = 0;
if (!max_probe_size) {
max_probe_size = PROBE_BUF_MAX;
@@ -499,7 +499,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
score = 0;
ret = 0; /* error was end of file, nothing read */
}
- pd.buf_size += ret;
+ pd.buf_size = buf_offset += ret;
pd.buf = &buf[offset];
memset(pd.buf + pd.buf_size, 0, AVPROBE_PADDING_SIZE);
--
1.7.5.4

View File

@ -0,0 +1,32 @@
From 1f41cffe1e3e79620f587545bdfcbd7e6e68ed29 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sun, 11 Nov 2012 00:01:24 +0100
Subject: [PATCH] mjpegdec: check SE.
Upstream-Status: Backport
Commit 1f41cffe1e3e79620f587545bdfcbd7e6e68ed29 release/1.1
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/mjpegdec.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 6b5266d..0a71a6f 100644
--- a/gst-libs/ext/libav/libavcodec/mjpegdec.c
+++ b/gst-libs/ext/libav/libavcodec/mjpegdec.c
@@ -905,6 +905,11 @@ static int mjpeg_decode_scan_progressive
int16_t *quant_matrix = s->quant_matrixes[ s->quant_index[c] ];
GetBitContext mb_bitmask_gb;
+ if (se > 63) {
+ av_log(s->avctx, AV_LOG_ERROR, "SE %d is too large\n", se);
+ return AVERROR_INVALIDDATA;
+ }
+
if (mb_bitmask) {
init_get_bits(&mb_bitmask_gb, mb_bitmask, s->mb_width*s->mb_height);
}
--

View File

@ -0,0 +1,34 @@
From 28bf685bfc6d0c744369cdf367f61a78d80d0b01 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Thu, 15 Nov 2012 16:41:28 +0100
Subject: [PATCH] pgssubdec: check RLE size before copying. Fix out of array
accesses
Upstream-Status: Backport
Commit 28bf685bfc6d0c744369cdf367f61a78d80d0b01 release/1.1
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c0d68be555f5858703383040e04fcd6529777061)
---
libavcodec/pgssubdec.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index 728f178..26a3c2a 100644
--- a/gst-libs/ext/libav/libavcodec/pgssubdec.c
+++ b/gst-libs/ext/libav/libavcodec/pgssubdec.c
@@ -202,6 +202,11 @@ static int parse_picture_segment(AVCodec
return -1;
}
+ if (buf_size > rle_bitmap_len) {
+ av_log(avctx, AV_LOG_ERROR, "too much RLE data\n");
+ return AVERROR_INVALIDDATA;
+ }
+
ctx->picture.w = width;
ctx->picture.h = height;
--

View File

@ -0,0 +1,44 @@
gst-ffmpeg: pngdec/filter: dont access out of array elements at the end
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Upstream-Status: Backport
Signed-off-by: Yue Tao <yue.tao@windriver.com>
---
libavcodec/pngdec.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 97c0ad1..193e35e 100644
--- a/gst-libs/ext/libav/libavcodec/pngdec.c
+++ b/gst-libs/ext/libav/libavcodec/pngdec.c
@@ -190,7 +190,7 @@ void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w
if(bpp >= 2) g = dst[1];\
if(bpp >= 3) b = dst[2];\
if(bpp >= 4) a = dst[3];\
- for(; i < size; i+=bpp) {\
+ for(; i <= size - bpp; i+=bpp) {\
dst[i+0] = r = op(r, src[i+0], last[i+0]);\
if(bpp == 1) continue;\
dst[i+1] = g = op(g, src[i+1], last[i+1]);\
@@ -206,13 +206,9 @@ void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w
else if(bpp == 2) UNROLL1(2, op)\
else if(bpp == 3) UNROLL1(3, op)\
else if(bpp == 4) UNROLL1(4, op)\
- else {\
- for (; i < size; i += bpp) {\
- int j;\
- for (j = 0; j < bpp; j++)\
- dst[i+j] = op(dst[i+j-bpp], src[i+j], last[i+j]);\
- }\
- }
+ for (; i < size; i++) {\
+ dst[i] = op(dst[i-bpp], src[i], last[i]);\
+ }\
/* NOTE: 'dst' can be equal to 'last' */
static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
--
1.7.5.4

View File

@ -0,0 +1,30 @@
gst-ffmpeg: qdm2: check array index before use, fix out of array
accesses
Upstream-Status: Backport
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/qdm2.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 4cf4b2f..1dfb8d5 100644
--- a/gst-libs/ext/libav/libavcodec/qdm2.c
+++ b/gst-libs/ext/libav/libavcodec/qdm2.c
@@ -1257,6 +1257,11 @@ static void qdm2_decode_super_block (QDM2Context *q)
for (i = 0; packet_bytes > 0; i++) {
int j;
+ if (i>=FF_ARRAY_ELEMS(q->sub_packet_list_A)) {
+ SAMPLES_NEEDED_2("too many packet bytes");
+ return;
+ }
+
q->sub_packet_list_A[i].next = NULL;
if (i > 0) {
--
1.7.5.4

View File

@ -0,0 +1,58 @@
gst-ffmpeg: qdm2dec: fix buffer overflow. Fixes NGS00144
This also adds a few lines of code from master that are needed for this fix.
Thanks to Phillip for suggestions to improve the patch.
Found-by: Phillip Langlois
Upstream-Status: Backport
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/qdm2.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 3aa9e5b..e000df8 100644
--- a/gst-libs/ext/libav/libavcodec/qdm2.c
+++ b/gst-libs/ext/libav/libavcodec/qdm2.c
@@ -76,6 +76,7 @@ do { \
#define SAMPLES_NEEDED_2(why) \
av_log (NULL,AV_LOG_INFO,"This file triggers some missing code. Please contact the developers.\nPosition: %s\n",why);
+#define QDM2_MAX_FRAME_SIZE 512
typedef int8_t sb_int8_array[2][30][64];
@@ -168,7 +169,7 @@ typedef struct {
/// I/O data
const uint8_t *compressed_data;
int compressed_size;
- float output_buffer[1024];
+ float output_buffer[QDM2_MAX_FRAME_SIZE * MPA_MAX_CHANNELS * 2];
/// Synthesis filter
MPADSPContext mpadsp;
@@ -1819,6 +1820,9 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
s->group_order = av_log2(s->group_size) + 1;
s->frame_size = s->group_size / 16; // 16 iterations per super block
+ if (s->frame_size > QDM2_MAX_FRAME_SIZE)
+ return AVERROR_INVALIDDATA;
+
s->sub_sampling = s->fft_order - 7;
s->frequency_range = 255 / (1 << (2 - s->sub_sampling));
@@ -1887,6 +1891,9 @@ static int qdm2_decode (QDM2Context *q, const uint8_t *in, int16_t *out)
int ch, i;
const int frame_size = (q->frame_size * q->channels);
+ if((unsigned)frame_size > FF_ARRAY_ELEMS(q->output_buffer)/2)
+ return -1;
+
/* select input buffer */
q->compressed_data = in;
q->compressed_size = q->checksum_size;
--
1.7.5.4

View File

@ -0,0 +1,36 @@
From 391e0fc6c90ced6656b74f50f3a487b6dc76ea63 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Thu, 29 Nov 2012 15:18:17 +0100
Subject: [PATCH] roqvideodec: check dimensions validity
Upstream-Status: Backport
Commit 391e0fc6c90ced6656b74f50f3a487b6dc76ea63 release/0.7
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ae610451170cd5a28b33950006ff0bd23036845)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/roqvideodec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index f0977f6..4e34231 100644
--- a/gst-libs/ext/libav/libavcodec/roqvideodec.c
+++ b/gst-libs/ext/libav/libavcodec/roqvideodec.c
@@ -157,6 +157,12 @@ static av_cold int roq_decode_init(AVCodecContext *avctx)
RoqContext *s = avctx->priv_data;
s->avctx = avctx;
+
+ if (avctx->width%16 || avctx->height%16) {
+ av_log_ask_for_sample(avctx, "dimensions not being a multiple of 16 are unsupported\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
s->width = avctx->width;
s->height = avctx->height;
avcodec_get_frame_defaults(&s->frames[0]);
--

View File

@ -0,0 +1,32 @@
gst-ffmpeg: smackerdec: Check that the last indexes are within the
table.
Fixes CVE-2011-3944
Upstream-Status: Backport
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/smacker.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 30f99b4..2a8bae8 100644
--- a/gst-libs/ext/libav/libavcodec/smacker.c
+++ b/gst-libs/ext/libav/libavcodec/smacker.c
@@ -259,6 +259,11 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
if(ctx.last[0] == -1) ctx.last[0] = huff.current++;
if(ctx.last[1] == -1) ctx.last[1] = huff.current++;
if(ctx.last[2] == -1) ctx.last[2] = huff.current++;
+ if(huff.current > huff.length){
+ ctx.last[0] = ctx.last[1] = ctx.last[2] = 1;
+ av_log(smk->avctx, AV_LOG_ERROR, "bigtree damaged\n");
+ return -1;
+ }
*recodes = huff.values;
--
1.7.5.4

View File

@ -0,0 +1,32 @@
gst-ffmpeg: vp3: Copy all 3 frames for thread updates.
This fixes a double release of the current frame on deinit.
Fixes CVE-2011-3934
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Upstream-Status: Backport
Signed-off-by: Yue.Tao <yue.tao@windriver.com>
---
libavcodec/vp3.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 738ae9f..b5daafc 100644
--- a/gst-libs/ext/libav/libavcodec/vp3.c
+++ b/gst-libs/ext/libav/libavcodec/vp3.c
@@ -1859,7 +1859,7 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *
||s->width != s1->width
||s->height!= s1->height) {
if (s != s1)
- copy_fields(s, s1, golden_frame, current_frame);
+ copy_fields(s, s1, golden_frame, keyframe);
return -1;
}
--
1.7.5.4

View File

@ -0,0 +1,183 @@
gst-ffmpeg: vp3: fix oob read for negative tokens and memleaks on error.
Upstream-Status: Backport
Signed-off-by: Yue.Tao <yue.tao@windriver.com>
---
libavcodec/vp3.c | 59 +++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 45 insertions(+), 14 deletions(-)
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 36715bb..ce14e63 100644
--- a/gst-libs/ext/libav/libavcodec/vp3.c
+++ b/gst-libs/ext/libav/libavcodec/vp3.c
@@ -45,6 +45,7 @@
#define FRAGMENT_PIXELS 8
static av_cold int vp3_decode_end(AVCodecContext *avctx);
+static void vp3_decode_flush(AVCodecContext *avctx);
//FIXME split things out into their own arrays
typedef struct Vp3Fragment {
@@ -890,7 +891,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
/* decode a VLC into a token */
token = get_vlc2(gb, vlc_table, 11, 3);
/* use the token to get a zero run, a coefficient, and an eob run */
- if (token <= 6) {
+ if ((unsigned) token <= 6U) {
eob_run = eob_run_base[token];
if (eob_run_get_bits[token])
eob_run += get_bits(gb, eob_run_get_bits[token]);
@@ -908,7 +909,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
coeff_i += eob_run;
eob_run = 0;
}
- } else {
+ } else if (token >= 0) {
bits_to_get = coeff_get_bits[token];
if (bits_to_get)
bits_to_get = get_bits(gb, bits_to_get);
@@ -942,6 +943,10 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
for (i = coeff_index+1; i <= coeff_index+zero_run; i++)
s->num_coded_frags[plane][i]--;
coeff_i++;
+ } else {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Invalid token %d\n", token);
+ return -1;
}
}
@@ -991,6 +996,8 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
/* unpack the Y plane DC coefficients */
residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_y_table], 0,
0, residual_eob_run);
+ if (residual_eob_run < 0)
+ return residual_eob_run;
/* reverse prediction of the Y-plane DC coefficients */
reverse_dc_prediction(s, 0, s->fragment_width[0], s->fragment_height[0]);
@@ -998,8 +1005,12 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
/* unpack the C plane DC coefficients */
residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,
1, residual_eob_run);
+ if (residual_eob_run < 0)
+ return residual_eob_run;
residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,
2, residual_eob_run);
+ if (residual_eob_run < 0)
+ return residual_eob_run;
/* reverse prediction of the C-plane DC coefficients */
if (!(s->avctx->flags & CODEC_FLAG_GRAY))
@@ -1036,11 +1047,17 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
for (i = 1; i <= 63; i++) {
residual_eob_run = unpack_vlcs(s, gb, y_tables[i], i,
0, residual_eob_run);
+ if (residual_eob_run < 0)
+ return residual_eob_run;
residual_eob_run = unpack_vlcs(s, gb, c_tables[i], i,
1, residual_eob_run);
+ if (residual_eob_run < 0)
+ return residual_eob_run;
residual_eob_run = unpack_vlcs(s, gb, c_tables[i], i,
2, residual_eob_run);
+ if (residual_eob_run < 0)
+ return residual_eob_run;
}
return 0;
@@ -1777,10 +1794,15 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *
Vp3DecodeContext *s = dst->priv_data, *s1 = src->priv_data;
int qps_changed = 0, i, err;
+#define copy_fields(to, from, start_field, end_field) memcpy(&to->start_field, &from->start_field, (char*)&to->end_field - (char*)&to->start_field)
+
if (!s1->current_frame.data[0]
||s->width != s1->width
- ||s->height!= s1->height)
+ ||s->height!= s1->height) {
+ if (s != s1)
+ copy_fields(s, s1, golden_frame, current_frame);
return -1;
+ }
if (s != s1) {
// init tables if the first frame hasn't been decoded
@@ -1796,8 +1818,6 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *
memcpy(s->motion_val[1], s1->motion_val[1], c_fragment_count * sizeof(*s->motion_val[1]));
}
-#define copy_fields(to, from, start_field, end_field) memcpy(&to->start_field, &from->start_field, (char*)&to->end_field - (char*)&to->start_field)
-
// copy previous frame data
copy_fields(s, s1, golden_frame, dsp);
@@ -1987,9 +2007,6 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx)
Vp3DecodeContext *s = avctx->priv_data;
int i;
- if (avctx->is_copy && !s->current_frame.data[0])
- return 0;
-
av_free(s->superblock_coding);
av_free(s->all_fragments);
av_free(s->coded_fragment_list[0]);
@@ -2016,12 +2033,7 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx)
free_vlc(&s->motion_vector_vlc);
/* release all frames */
- if (s->golden_frame.data[0])
- ff_thread_release_buffer(avctx, &s->golden_frame);
- if (s->last_frame.data[0] && s->last_frame.type != FF_BUFFER_TYPE_COPY)
- ff_thread_release_buffer(avctx, &s->last_frame);
- /* no need to release the current_frame since it will always be pointing
- * to the same frame as either the golden or last frame */
+ vp3_decode_flush(avctx);
return 0;
}
@@ -2341,6 +2353,23 @@ static void vp3_decode_flush(AVCodecContext *avctx)
ff_thread_release_buffer(avctx, &s->current_frame);
}
+static int vp3_init_thread_copy(AVCodecContext *avctx)
+{
+ Vp3DecodeContext *s = avctx->priv_data;
+
+ s->superblock_coding = NULL;
+ s->all_fragments = NULL;
+ s->coded_fragment_list[0] = NULL;
+ s->dct_tokens_base = NULL;
+ s->superblock_fragments = NULL;
+ s->macroblock_coding = NULL;
+ s->motion_val[0] = NULL;
+ s->motion_val[1] = NULL;
+ s->edge_emu_buffer = NULL;
+
+ return 0;
+}
+
AVCodec ff_theora_decoder = {
.name = "theora",
.type = AVMEDIA_TYPE_VIDEO,
@@ -2352,6 +2381,7 @@ AVCodec ff_theora_decoder = {
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_FRAME_THREADS,
.flush = vp3_decode_flush,
.long_name = NULL_IF_CONFIG_SMALL("Theora"),
+ .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp3_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context)
};
#endif
@@ -2367,5 +2397,6 @@ AVCodec ff_vp3_decoder = {
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_FRAME_THREADS,
.flush = vp3_decode_flush,
.long_name = NULL_IF_CONFIG_SMALL("On2 VP3"),
+ .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp3_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context)
};
--
1.7.5.4

View File

@ -0,0 +1,51 @@
From 2cac35086c9e103fa98960c546d5017e7363803a Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Fri, 25 Jan 2013 06:11:59 +0100
Subject: [PATCH] vqavideo: check chunk sizes before reading chunks
Upstream-Status: Backport
Commit 2cac35086c9e103fa98960c546d5017e7363803a release/0.7
Fixes out of array writes
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ab6c9332bfa1e20127a16392a0b85a4aa4840889)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/vqavideo.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index d1eab5b..6e1ce6c 100644
--- a/gst-libs/ext/libav/libavcodec/vqavideo.c
+++ b/gst-libs/ext/libav/libavcodec/vqavideo.c
@@ -527,6 +527,11 @@ static void vqa_decode_chunk(VqaContext *s)
chunk_size = AV_RB32(&s->buf[cbp0_chunk + 4]);
cbp0_chunk += CHUNK_PREAMBLE_SIZE;
+ if (chunk_size > MAX_CODEBOOK_SIZE - s->next_codebook_buffer_index) {
+ av_log(s->avctx, AV_LOG_ERROR, "cbp0 chunk too large (0x%X bytes)\n", chunk_size);
+ return AVERROR_INVALIDDATA;
+ }
+
/* accumulate partial codebook */
memcpy(&s->next_codebook_buffer[s->next_codebook_buffer_index],
&s->buf[cbp0_chunk], chunk_size);
@@ -550,6 +555,11 @@ static void vqa_decode_chunk(VqaContext *s)
chunk_size = AV_RB32(&s->buf[cbpz_chunk + 4]);
cbpz_chunk += CHUNK_PREAMBLE_SIZE;
+ if (chunk_size > MAX_CODEBOOK_SIZE - s->next_codebook_buffer_index) {
+ av_log(s->avctx, AV_LOG_ERROR, "cbpz chunk too large (0x%X bytes)\n", chunk_size);
+ return AVERROR_INVALIDDATA;
+ }
+
/* accumulate partial codebook */
memcpy(&s->next_codebook_buffer[s->next_codebook_buffer_index],
&s->buf[cbpz_chunk], chunk_size);
--
1.7.5.4

View File

@ -0,0 +1,68 @@
From 6043c431c97d55173f339fafbd033d3c0642e2e9 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Fri, 3 Oct 2014 01:50:27 +0200
Subject: [PATCH 2/2] avcodec/mjpegdec: check bits per pixel for changes
similar to dimensions
Upstream-Status: Backport
Fixes out of array accesses
Fixes: asan_heap-oob_16668e9_2_asan_heap-oob_16668e9_346_miss_congeniality_pegasus_mjpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Conflicts:
libavcodec/mjpegdec.c
---
libavcodec/mjpegdec.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/gst-libs/ext/libav/libavcodec/mjpegdec.c b/gst-libs/ext/libav/libavcodec/mjpegdec.c
index 84343c0..c0137d8 100644
--- a/gst-libs/ext/libav/libavcodec/mjpegdec.c
+++ b/gst-libs/ext/libav/libavcodec/mjpegdec.c
@@ -210,16 +210,16 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
{
- int len, nb_components, i, width, height, pix_fmt_id;
+ int len, nb_components, i, bits, width, height, pix_fmt_id;
/* XXX: verify len field validity */
len = get_bits(&s->gb, 16);
- s->bits= get_bits(&s->gb, 8);
+ bits= get_bits(&s->gb, 8);
- if(s->pegasus_rct) s->bits=9;
- if(s->bits==9 && !s->pegasus_rct) s->rct=1; //FIXME ugly
+ if(s->pegasus_rct) bits=9;
+ if(bits==9 && !s->pegasus_rct) s->rct=1; //FIXME ugly
- if (s->bits != 8 && !s->lossless){
+ if (bits != 8 && !s->lossless){
av_log(s->avctx, AV_LOG_ERROR, "only 8 bits/component accepted\n");
return -1;
}
@@ -239,7 +239,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
if (nb_components <= 0 ||
nb_components > MAX_COMPONENTS)
return -1;
- if (s->ls && !(s->bits <= 8 || nb_components == 1)){
+ if (s->ls && !(bits <= 8 || nb_components == 1)){
av_log(s->avctx, AV_LOG_ERROR, "only <= 8 bits/component or 16-bit gray accepted for JPEG-LS\n");
return -1;
}
@@ -272,10 +272,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
/* if different size, realloc/alloc picture */
/* XXX: also check h_count and v_count */
- if (width != s->width || height != s->height) {
+ if (width != s->width || height != s->height || bits != s->bits) {
av_freep(&s->qscale_table);
s->width = width;
+ s->bits= bits;
s->height = height;
s->interlaced = 0;

View File

@ -0,0 +1,22 @@
Disable yasm for libav when --disable-yasm
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Shane Wang <shane.wang@intel.com>
diff -r f2f8f74c6e30 configure.ac
--- a/configure.ac Thu Dec 22 23:56:09 2011 +0800
+++ b/configure.ac Thu Dec 22 23:57:37 2011 +0800
@@ -325,6 +325,12 @@
--enable-gpl"
fi
+ AC_ARG_ENABLE(yasm,
+ [AC_HELP_STRING([--disable-yasm], [disable use of yasm assembler])])
+ if test "x$enable_yasm" = "xno"; then
+ embffmpeg_configure_args="$embffmpeg_configure_args --disable-yasm"
+ fi
+
# if we are cross-compiling, tell ffmpeg so
target_os=`echo $host_os | sed 's/-gnu//'`
if test "x$cross_compiling" = xyes; then

View File

@ -0,0 +1,100 @@
gst-ffmpeg: Security Advisory - ffmpeg - CVE-2013-0855
Upstream-Status: Backport
Signed-off-by: Yue Tao <yue.tao@windriver.com>
diff --git a/gst-libs/ext/libav/libavcodec/alac.c.old b/gst-libs/ext/libav/libavcodec/alac.c
index 2a0df8c..bcbd56d 100644
--- a/gst-libs/ext/libav/libavcodec/alac.c.old
+++ b/gst-libs/ext/libav/libavcodec/alac.c
@@ -87,18 +87,44 @@ typedef struct {
int wasted_bits;
} ALACContext;
-static void allocate_buffers(ALACContext *alac)
+static av_cold int alac_decode_close(AVCodecContext *avctx)
+{
+ ALACContext *alac = avctx->priv_data;
+
+ int chan;
+ for (chan = 0; chan < MAX_CHANNELS; chan++) {
+ av_freep(&alac->predicterror_buffer[chan]);
+ av_freep(&alac->outputsamples_buffer[chan]);
+ av_freep(&alac->wasted_bits_buffer[chan]);
+ }
+
+ return 0;
+}
+
+static int allocate_buffers(ALACContext *alac)
{
int chan;
+ int buf_size;
+
+ if (alac->setinfo_max_samples_per_frame > INT_MAX / sizeof(int32_t))
+ goto buf_alloc_fail;
+ buf_size = alac->setinfo_max_samples_per_frame * sizeof(int32_t);
+
for (chan = 0; chan < MAX_CHANNELS; chan++) {
- alac->predicterror_buffer[chan] =
- av_malloc(alac->setinfo_max_samples_per_frame * 4);
- alac->outputsamples_buffer[chan] =
- av_malloc(alac->setinfo_max_samples_per_frame * 4);
+ FF_ALLOC_OR_GOTO(alac->avctx, alac->predicterror_buffer[chan],
+ buf_size, buf_alloc_fail);
- alac->wasted_bits_buffer[chan] = av_malloc(alac->setinfo_max_samples_per_frame * 4);
+ FF_ALLOC_OR_GOTO(alac->avctx, alac->outputsamples_buffer[chan],
+ buf_size, buf_alloc_fail);
+
+ FF_ALLOC_OR_GOTO(alac->avctx, alac->wasted_bits_buffer[chan],
+ buf_size, buf_alloc_fail);
}
+ return 0;
+buf_alloc_fail:
+ alac_decode_close(alac->avctx);
+ return AVERROR(ENOMEM);
}
static int alac_set_info(ALACContext *alac)
@@ -131,8 +157,6 @@ static int alac_set_info(ALACContext *alac)
bytestream_get_be32(&ptr); /* bitrate ? */
bytestream_get_be32(&ptr); /* samplerate */
- allocate_buffers(alac);
-
return 0;
}
@@ -659,6 +683,7 @@ static int alac_decode_frame(AVCodecContext *avctx,
static av_cold int alac_decode_init(AVCodecContext * avctx)
{
+ int ret;
ALACContext *alac = avctx->priv_data;
alac->avctx = avctx;
alac->numchannels = alac->avctx->channels;
@@ -674,18 +699,9 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
return -1;
}
- return 0;
-}
-
-static av_cold int alac_decode_close(AVCodecContext *avctx)
-{
- ALACContext *alac = avctx->priv_data;
-
- int chan;
- for (chan = 0; chan < MAX_CHANNELS; chan++) {
- av_freep(&alac->predicterror_buffer[chan]);
- av_freep(&alac->outputsamples_buffer[chan]);
- av_freep(&alac->wasted_bits_buffer[chan]);
+ if ((ret = allocate_buffers(alac)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error allocating buffers\n");
+ return ret;
}
return 0;

View File

@ -0,0 +1,26 @@
avcodec/cdgraphics: check buffer size before use
Fixes out of array accesses
Backported from:http://git.videolan.org/?p=ffmpeg.git;a=commit;h=ad002e1a13a8df934bd6cb2c84175a4780ab8942
Upstream-Status: Backport
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Ming Liu <ming.liu@windriver.com>
diff -urpN a/gst-libs/ext/libav/libavcodec/cdgraphics.c b/gst-libs/ext/libav/libavcodec/cdgraphics.c
--- a/gst-libs/ext/libav/libavcodec/cdgraphics.c 2013-07-18 13:17:08.399876575 +0800
+++ b/gst-libs/ext/libav/libavcodec/cdgraphics.c 2013-07-18 13:18:05.880502267 +0800
@@ -291,7 +291,9 @@ static int cdg_decode_frame(AVCodecConte
inst = bytestream_get_byte(&buf);
inst &= CDG_MASK;
buf += 2; /// skipping 2 unneeded bytes
- bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
+
+ if (buf_size > CDG_HEADER_SIZE)
+ bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
if ((command & CDG_MASK) == CDG_COMMAND) {
switch (inst) {

View File

@ -0,0 +1,57 @@
Backport http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=5f654897e325349dacf2546674e0510bb72ecb50;hp=250cebeb3b348c3da71f9972eb500d6005dc01f1
Fixes these errors on x86
libavcodec/x86/h264_qpel_mmx.c: Assembler messages:
libavcodec/x86/h264_qpel_mmx.c:1294: Error: operand type mismatch for `cmp'
libavcodec/x86/h264_qpel_mmx.c:1294: Error: operand type mismatch for `cmp'
libavcodec/x86/h264_qpel_mmx.c:1298: Error: operand type mismatch for `cmp'
libavcodec/x86/h264_qpel_mmx.c:1298: Error: operand type mismatch for `cmp'
libavcodec/x86/h264_qpel_mmx.c:964: Error: operand type mismatch for `cmp'
libavcodec/x86/h264_qpel_mmx.c:964: Error: operand type mismatch for `cmp'
libavcodec/x86/h264_qpel_mmx.c:964: Error: operand type mismatch for `cmp'
make[5]: *** [libavcodec/x86/dsputil_mmx.o] Error 1
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Backport
Index: gst-ffmpeg-0.10.13/gst-libs/ext/libav/libavcodec/x86/h264_qpel_mmx.c
===================================================================
--- gst-ffmpeg-0.10.13.orig/gst-libs/ext/libav/libavcodec/x86/h264_qpel_mmx.c 2012-03-30 11:39:41.324522051 -0700
+++ gst-ffmpeg-0.10.13/gst-libs/ext/libav/libavcodec/x86/h264_qpel_mmx.c 2012-03-30 11:54:08.152564075 -0700
@@ -398,7 +398,7 @@
"2: \n\t"\
\
: "+a"(src), "+c"(dst)\
- : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "g"(h)\
+ : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "rm"(h)\
: "memory"\
);\
src += 4-(h+5)*srcStride;\
@@ -446,7 +446,7 @@
QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 15*48)\
"2: \n\t"\
: "+a"(src)\
- : "c"(tmp), "S"((x86_reg)srcStride), "g"(size)\
+ : "c"(tmp), "S"((x86_reg)srcStride), "rm"(size)\
: "memory"\
);\
tmp += 4;\
@@ -823,7 +823,7 @@
"2: \n\t"\
\
: "+a"(src), "+c"(dst)\
- : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "g"(h)\
+ : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "rm"(h)\
: XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \
"%xmm4", "%xmm5", "%xmm6", "%xmm7",)\
"memory"\
@@ -878,7 +878,7 @@
QPEL_H264HV_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, 15*48)
"2: \n\t"
: "+a"(src)
- : "c"(tmp), "S"((x86_reg)srcStride), "g"(size)
+ : "c"(tmp), "S"((x86_reg)srcStride), "rm"(size)
: XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3",
"%xmm4", "%xmm5", "%xmm6", "%xmm7",)
"memory"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
diff --git a/gst-libs/ext/libav/configure b/gst-libs/ext/libav/configure
index 8473069..4f74952 100755
--- a/gst-libs/ext/libav/configure
+++ b/gst-libs/ext/libav/configure
Fix gst-ffmpeg build issues for libav on e500mc (fsl-p4080)
Upstream-Status: Backport
Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
@@ -2210,6 +2210,10 @@ elif enabled ppc; then
cpuflags="-mcpu=cell"
enable ldbrx
;;
+ e500mc)
+ cpuflags="-mcpu=e500mc"
+ disable altivec
+ ;;
e500v2)
cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
disable altivec

View File

@ -0,0 +1,19 @@
libav: Add configs for ppc e5500
Upstream-Status: Pending
Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
--- gst-ffmpeg-0.10.13/gst-libs/ext/libav/configure 2013-06-20 05:18:36.073104964 -0400
+++ gst-ffmpeg-0.10.13/gst-libs/ext/libav/configure 2013-06-20 05:18:38.269104150 -0400
@@ -2222,6 +2222,10 @@
cpuflags="-mcpu=8540 -mhard-float"
disable altivec
;;
+ e5500)
+ cpuflags="-mcpu=e5500 -mhard-float"
+ disable altivec
+ ;;
esac
elif enabled x86; then

View File

@ -0,0 +1,16 @@
Lower the rank of ffmpeg plugin so codecs that hook into accelerated pieces (e.g. dsp or hw engines) can get picked over this
Derived from OE by Dongxiao Xu <dongxiao.xu@intel.com>
Upstream-Status: Inappropriate [embedded specific]
--- /tmp/gstffmpegdec.c 2009-03-05 09:31:15.000000000 +0100
+++ gst-ffmpeg-0.10.6/ext/ffmpeg/gstffmpegdec.c 2009-03-05 09:33:09.000000000 +0100
@@ -2588,7 +2588,7 @@
case CODEC_ID_MSMPEG4V3:
case CODEC_ID_H264:
case CODEC_ID_COOK:
- rank = GST_RANK_PRIMARY;
+ rank = GST_RANK_SECONDARY;
break;
case CODEC_ID_DVVIDEO:
/* we have a good dv decoder, fast on both ppc as well as x86. they say

View File

@ -0,0 +1,90 @@
SUMMARY = "FFmpeg-based GStreamer plug-in"
SECTION = "multimedia"
LICENSE = "GPLv2+ & LGPLv2+ & ( (GPLv2+ & LGPLv2.1+) | (GPLv3+ & LGPLv3+) )"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://ext/libpostproc/gstpostproc.c;beginline=1;endline=18;md5=5896e445e41681324381f5869ee33d38 \
file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605 \
file://ext/ffmpeg/gstffmpeg.h;beginline=1;endline=18;md5=ff65467b0c53cdfa98d0684c1bc240a9 \
file://gst-libs/ext/libav/LICENSE;md5=abc3b8cb02856aa7823bbbd162d16232 \
file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=e344c8fa836c3a41c4cbd79d7bd3a379 \
file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
LICENSE_FLAGS = "commercial"
HOMEPAGE = "http://www.gstreamer.net/"
DEPENDS = "gstreamer gst-plugins-base zlib bzip2 yasm-native libpostproc"
inherit autotools-brokensep pkgconfig
SRC_URI = "http://gstreamer.freedesktop.org/src/${BPN}/${BPN}-${PV}.tar.bz2 \
file://lower-rank.diff \
file://configure-fix.patch \
file://h264_qpel_mmx.patch \
file://libav_e500mc.patch \
file://libav_e5500.patch \
file://gst-ffmpeg-CVE-2013-3674.patch \
file://0001-avformat-mpegtsenc-Check-data-array-size-in-mpegts_w.patch \
file://0001-vqavideo-check-chunk-sizes-before-reading-chunks.patch \
file://0001-avcodec-msrle-use-av_image_get_linesize-to-calculate.patch \
file://0001-huffyuvdec-Skip-len-0-cases.patch \
file://0001-huffyuvdec-Check-init_vlc-return-codes.patch \
file://0001-alsdec-check-block-length.patch \
file://0001-pgssubdec-check-RLE-size-before-copying.-Fix-out-of-.patch \
file://0001-atrac3dec-Check-coding-mode-against-channels.patch \
file://0001-eamad-fix-out-of-array-accesses.patch \
file://0001-mjpegdec-check-SE.patch \
file://0001-alac-fix-nb_samples-order-case.patch \
file://0001-h264-correct-ref-count-check-and-limit-fix-out-of-ar.patch \
file://0001-roqvideodec-check-dimensions-validity.patch \
file://0001-aacdec-check-channel-count.patch \
file://0001-pngdec-filter-dont-access-out-of-array-elements-at-t.patch \
file://0001-error_concealment-Check-that-the-picture-is-not-in-a.patch \
file://0001-vp3-fix-oob-read-for-negative-tokens-and-memleaks-on.patch \
file://0001-vp3-Copy-all-3-frames-for-thread-updates.patch \
file://0001-h264_sei-Fix-infinite-loop.patch \
file://0001-avcodec-parser-reset-indexes-on-realloc-failure.patch \
file://0001-avcodec-rpza-Perform-pointer-advance-and-checks-befo.patch \
file://gst-ffmpeg-CVE-2013-0855.patch \
file://0001-qdm2dec-fix-buffer-overflow.patch \
file://0001-smackerdec-Check-that-the-last-indexes-are-within-th.patch \
file://0001-avcodec-dsputil-fix-signedness-in-sizeof-comparissio.patch \
file://0001-error-concealment-initialize-block-index.patch \
file://0001-qdm2-check-array-index-before-use-fix-out-of-array-a.patch \
file://0001-lavf-compute-probe-buffer-size-more-reliably.patch \
file://0001-ffserver-set-oformat.patch \
file://0001-h264-set-parameters-from-SPS-whenever-it-changes.patch \
file://0001-h264-skip-error-concealment-when-SPS-and-slices-are-.patch \
file://0001-avcodec-smc-fix-off-by-1-error.patch \
file://0002-avcodec-mjpegdec-check-bits-per-pixel-for-changes-si.patch \
file://libav-9.patch \
"
SRC_URI[md5sum] = "7f5beacaf1312db2db30a026b36888c4"
SRC_URI[sha256sum] = "76fca05b08e00134e3cb92fa347507f42cbd48ddb08ed3343a912def187fbb62"
PR = "r8"
GSTREAMER_DEBUG ?= "--disable-debug"
FFMPEG_EXTRA_CONFIGURE = "--with-ffmpeg-extra-configure"
# pass --cpu for powerpc. get cpu name by stripping "ppc" or "ppc64"
# from DEFAULTTUNE
FFMPEG_CPU_powerpc = "--cpu=${@d.getVar('DEFAULTTUNE')[3:]}"
FFMPEG_CPU_powerpc64 = "--cpu=${@d.getVar('DEFAULTTUNE')[5:]}"
FFMPEG_EXTRA_CONFIGURE_COMMON_ARG = "--target-os=linux ${FFMPEG_CPU} \
--cc='${CC}' --as='${CC}' --ld='${CC}' --nm='${NM}' --ar='${AR}' \
--ranlib='${RANLIB}' \
${GSTREAMER_DEBUG}"
FFMPEG_EXTRA_CONFIGURE_COMMON = \
'${FFMPEG_EXTRA_CONFIGURE}="${FFMPEG_EXTRA_CONFIGURE_COMMON_ARG}"'
EXTRA_OECONF = "${FFMPEG_EXTRA_CONFIGURE_COMMON}"
PACKAGECONFIG ??= "external-libav"
PACKAGECONFIG[external-libav] = "--with-system-ffmpeg,,libav"
PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc"
FILES_${PN} += "${libdir}/gstreamer-0.10/*.so"
FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug"
FILES_${PN}-dev += "${libdir}/gstreamer-0.10/*.la"
FILES_${PN}-staticdev += "${libdir}/gstreamer-0.10/*.a"

View File

@ -0,0 +1,14 @@
require gst-fluendo.inc
SUMMARY = "Fluendo closed-format mp3 GStreamer plug-in"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=259a43dd1c9854b71fc396f74699f4d2"
LICENSE_FLAGS = "commercial"
GSTREAMER_DEBUG ?= "--disable-debug"
EXTRA_OECONF += "${GSTREAMER_DEBUG} --with-gstreamer-api=0.10"
acpaths = "-I ${S}/common/m4 -I ${S}/m4"
SRC_URI[md5sum] = "adf0390f3416bb72f91c358528be0c38"
SRC_URI[sha256sum] = "dae0d0559a4e159c0dd92b7e18de059a5783f8d038904c7de4ca6393f7d55c7d"

View File

@ -0,0 +1,12 @@
require gst-fluendo.inc
SUMMARY = "Fluendo MPEG Transport Stream and Program Stream demuxer for GStreamer"
LICENSE = "MPLv1.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=be282f1c3cc9a98cc0dc5c2b25dfc510 \
file://src/gstmpegdemux.h;beginline=1;endline=19;md5=a9e90033f59897b91664d9f2a2ff01dd"
LICENSE_FLAGS = "commercial"
acpaths = "-I ${S}/common/m4 -I ${S}/m4"
SRC_URI[md5sum] = "7c4fb993f80b9ae631b11897733f0970"
SRC_URI[sha256sum] = "df04c91cc8e5d9a892c2492ed989974b4547beaa2a3647649e85113317897424"

View File

@ -0,0 +1,14 @@
SUMMARY = "Fluendo closed-format GStreamer plug-in"
SECTION = "multimedia"
HOMEPAGE = "https://core.fluendo.com/gstreamer/trac/wiki"
DEPENDS = "gstreamer gst-plugins-base zlib"
inherit autotools pkgconfig
SRC_URI = "http://core.fluendo.com/gstreamer/src/${BPN}/${BPN}-${PV}.tar.bz2"
FILES_${PN} += "${libdir}/gstreamer-0.10/*.so"
FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug"
FILES_${PN}-dev += "${libdir}/gstreamer-0.10/*.la ${libdir}/gstreamer-0.10/*.a"
EXTRA_OECONF = "--disable-valgrind"

View File

@ -0,0 +1,73 @@
SUMMARY = "GStreamer package groups"
LICENSE = "MIT"
COMMERCIAL_PLUGINS = "${COMMERCIAL_AUDIO_PLUGINS} ${COMMERCIAL_VIDEO_PLUGINS}"
DEPENDS_UGLY="${@'gst-plugins-ugly' if 'ugly' in COMMERCIAL_PLUGINS.split('-') else ''}"
DEPENDS_BAD="${@'gst-plugins-bad' if 'bad' in COMMERCIAL_PLUGINS.split('-') else ''}"
DEPENDS = "gstreamer gst-plugins-base gst-plugins-good ${DEPENDS_UGLY} ${DEPENDS_BAD}"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
PR = "r13"
PACKAGES = "\
gst-meta-base \
gst-meta-x11-base \
gst-meta-audio \
gst-meta-debug \
gst-meta-video"
ALLOW_EMPTY_gst-meta-base = "1"
ALLOW_EMPTY_gst-meta-x11-base = "1"
ALLOW_EMPTY_gst-meta-audio = "1"
ALLOW_EMPTY_gst-meta-debug = "1"
ALLOW_EMPTY_gst-meta-video = "1"
RDEPENDS_gst-meta-base = "\
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gst-meta-x11-base', '', d)} \
gstreamer \
gst-plugins-base-playbin \
gst-plugins-base-decodebin \
gst-plugins-base-decodebin2 \
gst-plugins-base-gio \
gst-plugins-base-alsa \
gst-plugins-base-volume \
gst-plugins-base-audioconvert \
gst-plugins-base-audioresample \
gst-plugins-base-typefindfunctions \
gst-plugins-base-videoscale \
gst-plugins-base-ffmpegcolorspace \
gst-plugins-good-autodetect \
gst-plugins-good-souphttpsrc"
RRECOMMENDS_gst-meta-x11-base = "\
gst-plugins-base-ximagesink \
gst-plugins-base-xvimagesink"
RDEPENDS_gst-meta-audio = "\
gst-meta-base \
gst-plugins-base-vorbis \
gst-plugins-base-ogg \
gst-plugins-good-wavparse \
gst-plugins-good-flac \
${COMMERCIAL_AUDIO_PLUGINS}"
RDEPENDS_gst-meta-debug = "\
gst-meta-base \
gst-plugins-good-debug \
gst-plugins-base-audiotestsrc \
gst-plugins-base-videotestsrc"
RDEPENDS_gst-meta-video = "\
gst-meta-base \
gst-plugins-good-avi \
gst-plugins-good-matroska \
gst-plugins-base-theora \
${COMMERCIAL_VIDEO_PLUGINS}"
RRECOMMENDS_gst-meta-video = "\
gst-meta-audio"

View File

@ -0,0 +1,18 @@
Upstream-Status: Pending
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Index: gst-openmax-0.10.1/omx/gstomx.c
===================================================================
--- gst-openmax-0.10.1.orig/omx/gstomx.c 2010-09-30 18:00:24.000000000 -0700
+++ gst-openmax-0.10.1/omx/gstomx.c 2011-05-17 23:08:08.794535872 -0700
@@ -238,7 +238,8 @@
const gchar *element_name = gst_structure_nth_field_name (element_table, i);
GstStructure *element = get_element_entry (element_name);
const gchar *type_name, *parent_type_name;
- const gchar *component_name, *component_role, *library_name;
+ const gchar *component_name, *library_name;
+ const gchar __attribute__((__unused__)) *component_role;
GType type;
gint rank;

View File

@ -0,0 +1,46 @@
Rename static functions that use GLib naming conventions as one of them
(g_ptr_array_insert) has now been added to GLib.
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@intel.com>
diff --git a/omx/gstomx_util.c b/omx/gstomx_util.c
index 423e441..579dbf5 100644
--- a/omx/gstomx_util.c
+++ b/omx/gstomx_util.c
@@ -85,7 +85,7 @@ static gboolean initialized;
*/
static void
-g_ptr_array_clear (GPtrArray * array)
+omx_g_ptr_array_clear (GPtrArray * array)
{
guint index;
for (index = 0; index < array->len; index++)
@@ -93,7 +93,7 @@ g_ptr_array_clear (GPtrArray * array)
}
static void
-g_ptr_array_insert (GPtrArray * array, guint index, gpointer data)
+omx_g_ptr_array_insert (GPtrArray * array, guint index, gpointer data)
{
if (index + 1 > array->len) {
g_ptr_array_set_size (array, index + 1);
@@ -394,7 +394,7 @@ g_omx_core_unload (GOmxCore * core)
}
core_for_each_port (core, g_omx_port_free);
- g_ptr_array_clear (core->ports);
+ omx_g_ptr_array_clear (core->ports);
}
static inline GOmxPort *
@@ -418,7 +418,7 @@ g_omx_core_new_port (GOmxCore * core, guint index)
}
port = g_omx_port_new (core, index);
- g_ptr_array_insert (core->ports, index, port);
+ omx_g_ptr_array_insert (core->ports, index, port);
return port;
}

View File

@ -0,0 +1,35 @@
SUMMARY = "GStreamer plug-in for communication with OpenMAX IL components"
DESCRIPTION = "GstOpenMAX is a GStreamer plug-in that allows \
communication with OpenMAX Integration Layer (IL) components. OpenMAX \
IL is an industry standard that provides an abstraction layer for \
computer graphics, video, and sound routines."
HOMEPAGE = "http://freedesktop.org/wiki/GstOpenMAX"
DEPENDS = "gstreamer"
RDEPENDS_${PN} = "libomxil"
LICENSE = "LGPLv2.1"
LICENSE_FLAGS = "commercial"
LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24 \
file://util/sem.h;beginline=1;endline=20;md5=accce5550d5583b839b441a0623f09fc"
SRC_URI = "http://gstreamer.freedesktop.org/src/gst-openmax/gst-openmax-${PV}.tar.bz2 \
file://gcc_4.6.patch \
file://ptr-array.patch \
"
inherit autotools pkgconfig
# Tell configure that this isn't a development snapshot so we don't want
# -Werror (hopefully fixed in 0.10.2)
export GST_CVS="no"
EXTRA_OECONF += "--disable-valgrind"
PR = "r4"
FILES_${PN} += "${libdir}/gstreamer-0.10/libgstomx.so"
FILES_${PN}-dev += "${libdir}/gstreamer-0.10/libgstomx.la"
FILES_${PN}-staticdev += "${libdir}/gstreamer-0.10/libgstomx.a"
FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug/"
SRC_URI[md5sum] = "4d0370bfe99dea20918c84347abadb4e"
SRC_URI[sha256sum] = "9074d5a0591995133d19cfb15144f19664f902c1623f996595695cf2c2070e1f"

View File

@ -0,0 +1,50 @@
require gst-plugins.inc
LICENSE = "GPLv2+ & LGPLv2+ & LGPLv2.1+ "
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
file://gst/tta/filters.h;beginline=12;endline=29;md5=629b0c7a665d155a6677778f4460ec06 \
file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605 \
file://gst/tta/crc32.h;beginline=12;endline=29;md5=71a904d99ce7ae0c1cf129891b98145c"
DEPENDS += "gst-plugins-base"
PR = "r4"
inherit gettext gsettings
EXTRA_OECONF += "--disable-experimental \
--disable-sdl --disable-cdaudio --disable-directfb \
--disable-vdpau --disable-apexsink"
PACKAGECONFIG ??= "bzip curl \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'rsvg', '', d)}"
PACKAGECONFIG[bzip] = "--enable-bz2,--disable-bz2,bzip2"
PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
PACKAGECONFIG[rsvg] = "--enable-rsvg,--disable-rsvg,librsvg,"
PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc"
PACKAGECONFIG[neon] = "--enable-neon,--disable-neon,neon"
PACKAGECONFIG[mms] = "--enable-libmms,--disable-libmms,libmms"
PACKAGECONFIG[cog] = "--enable-cog,--disable-cog,libpng"
PACKAGECONFIG[faad] = "--enable-faad,--disable-faad,faad2"
PACKAGECONFIG[jp2k] = "--enable-jp2k,--disable-jp2k,jasper"
PACKAGECONFIG[modplug] = "--enable-modplug,--disable-modplug,libmodplug"
PACKAGECONFIG[opus] = "--enable-opus,--disable-opus,libopus"
PACKAGECONFIG[sndfile] = "--enable-sndfile,--disable-sndfile,libsndfile1"
PACKAGECONFIG[vp8] = "--enable-vp8,--disable-vp8,libvpx"
PACKAGECONFIG[ass] = "--enable-assrender,--disable-assrender,libass"
PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft"
PACKAGECONFIG[schro] = "--enable-schro,--disable-schro,schroedinger"
PACKAGECONFIG[dc1394] = "--enable-dc1394,--disable-dc1394,libdc1394"
PACKAGECONFIG[faac] = "--enable-faac,--disable-faac,faac"
PACKAGECONFIG[rtmp] = "--enable-rtmp,--disable-rtmp,rtmpdump"
ARM_INSTRUCTION_SET = "arm"
do_configure_prepend() {
# This m4 file contains nastiness which conflicts with libtool 2.2.2
rm ${S}/m4/lib-link.m4 || true
}
SRC_URI[md5sum] = "fcb09798114461955260e4d940db5987"
SRC_URI[sha256sum] = "0eae7d1a1357ae8377fded6a1b42e663887beabe0e6cc336e2ef9ada42e11491"

View File

@ -0,0 +1,37 @@
audioresample: Fix build on x86 if emmintrin.h is available but can't be used
On x86, EMMINTRIN is defined but not usable without SSE so check for
__SSE__ and __SSE2__ as well.
https://bugzilla.gnome.org/show_bug.cgi?id=670690
Upstream-Status: Backport
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
gst/audioresample/resample.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gst/audioresample/resample.c b/gst/audioresample/resample.c
index 98d006c..481fa01 100644
--- a/gst/audioresample/resample.c
+++ b/gst/audioresample/resample.c
@@ -77,13 +77,13 @@
#define EXPORT G_GNUC_INTERNAL
#ifdef _USE_SSE
-#ifndef HAVE_XMMINTRIN_H
+#if !defined(__SSE__) || !defined(HAVE_XMMINTRIN_H)
#undef _USE_SSE
#endif
#endif
#ifdef _USE_SSE2
-#ifndef HAVE_EMMINTRIN_H
+#if !defined(__SSE2__) || !defined(HAVE_EMMINTRIN_H)
#undef _USE_SSE2
#endif
#endif
--
1.7.1

View File

@ -0,0 +1,27 @@
Upstream-Status: Submitted [similar patch by other author, bugzilla]
Bugtracker-URL: https://bugzilla.gnome.org/show_bug.cgi?id=663600
Prepend PKG_CONFIG_SYSROOT to includedir, so configure doesn't
search for gstconfig.h in /usr/include.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1901bcf..460fb0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -435,7 +435,7 @@ AG_GST_CHECK_PLUGIN(volume)
dnl check for gstreamer core features (subsystems)
dnl FIXME: this assumes srcdir == builddir for uninstalled setups
GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-0.10`"/gst/gstconfig.h"
-AG_GST_PARSE_SUBSYSTEM_DISABLES($GST_CONFIGPATH)
+AG_GST_PARSE_SUBSYSTEM_DISABLES($PKG_CONFIG_SYSROOT_DIR$GST_CONFIGPATH)
AM_CONDITIONAL(USE_XML, test $GST_DISABLE_XML != "1")
dnl disable plug-ins that require libxml2's HTML support if it is not available
--
1.7.5.4

View File

@ -0,0 +1,20 @@
Remove -DTREMOR option since Tremor has dropped its internal
libogg2, and gst-plugins-base has dependency on that.
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
diff -r 70065fb4e085 ext/vorbis/Makefile.am
--- a/ext/vorbis/Makefile.am Tue Mar 13 16:36:56 2012 +0800
+++ b/ext/vorbis/Makefile.am Tue Mar 13 16:38:53 2012 +0800
@@ -30,7 +30,7 @@
gstvorbisdec.c gstvorbisdeclib.c gstvorbiscommon.c
libgstivorbisdec_la_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
- -DTREMOR $(IVORBIS_CFLAGS)
+ $(IVORBIS_CFLAGS)
libgstivorbisdec_la_LIBADD = \
$(top_builddir)/gst-libs/gst/tag/libgsttag-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/audio/libgstaudio-@GST_MAJORMINOR@.la \

View File

@ -0,0 +1,39 @@
require gst-plugins.inc
LICENSE = "GPLv2+ & LGPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=622921ffad8cb18ab906c56052788a3f \
file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605 \
file://gst/ffmpegcolorspace/utils.c;beginline=1;endline=20;md5=9c83a200b8e597b26ca29df20fc6ecd0"
DEPENDS += "alsa-lib liboil libogg libvorbis libtheora util-linux tremor glib-2.0-native"
SRC_URI += "file://gst-plugins-base-tremor.patch \
file://configure.ac-fix-subparse-plugin.patch \
file://audioresample-Fix-build-on-x86-if-emmintrin.h-is-ava.patch \
"
SRC_URI[md5sum] = "776c73883e567f67b9c4a2847d8d041a"
SRC_URI[sha256sum] = "2cd3b0fa8e9b595db8f514ef7c2bdbcd639a0d63d154c00f8c9b609321f49976"
PR = "r8"
inherit gettext
EXTRA_OECONF += "--disable-freetypetest"
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
PACKAGECONFIG[gnomevfs] = "--enable-gnome_vfs,--disable-gnome_vfs,gnome-vfs"
PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc"
PACKAGECONFIG[pango] = "--enable-pango,--disable-pango,pango"
PACKAGECONFIG[x11] = "--enable-x --enable-xvideo,--disable-x --disable-xvideo,virtual/libx11 libxv libsm libice"
do_configure_prepend() {
# This m4 file contains nastiness which conflicts with libtool 2.2.2
rm -f ${S}/m4/lib-link.m4
}
FILES_${PN} += "${datadir}/${BPN}"
CACHED_CONFIGUREVARS_append_i586 = " ac_cv_header_emmintrin_h=no ac_cv_header_xmmintrin_h=no"

View File

@ -0,0 +1,35 @@
From 14d51cbefef19737e7ab2b6818ee1d3bdb248d12 Mon Sep 17 00:00:00 2001
From: Jeremy Stashluk <jstashluk@dekaresearch.com>
Date: Wed, 6 Feb 2013 09:59:48 -0500
Subject: [PATCH] conditional gl framebuffer undefined use
The OpenGL extension GL_ARB_framebuffer_object defines the macro
GL_FRAMEBUFFER_UNDEFINED. The macro will only need to map to an error
string if the extension provides functions that might return the macro.
Upstream-Status: Pending
Signed-off-by: Jeremy Stashluk <jstashluk@dekaresearch.com>
---
gst-libs/gst/gl/gstgldisplay.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c
index 3ed0b71..64c6c2c 100644
--- a/gst-libs/gst/gl/gstgldisplay.c
+++ b/gst-libs/gst/gl/gstgldisplay.c
@@ -2177,9 +2177,11 @@ gst_gl_display_check_framebuffer_status (void)
GST_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS");
break;
+#if defined(GL_ARB_framebuffer_object)
case GL_FRAMEBUFFER_UNDEFINED:
GST_ERROR ("GL_FRAMEBUFFER_UNDEFINED");
break;
+#endif
default:
GST_ERROR ("General FBO error");
--
1.7.9.5

View File

@ -0,0 +1,25 @@
require recipes-multimedia/gstreamer/gst-plugins.inc
LICENSE = "GPLv2+ & LGPLv2+ & LGPLv2.1+ "
LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
SRC_URI[md5sum] = "ac70ede13f79978d56eaed8abaa3c938"
SRC_URI[sha256sum] = "48340b6a4b8abce16344a7bc33e74a94fdcce4f57ef6342cdf2f941c429bf210"
SRC_URI += " file://0001-conditional-gl-framebuffer-undefined-use.patch"
DEPENDS += "gst-plugins-base virtual/libgles2 virtual/egl jpeg libpng glew"
PR = "r4"
inherit gettext
# This package doesn't have a configure switch for EGL or GL, so forcibly tell
# configure that it can't find gl.h so it always uses EGL. If/when we have some
# way for machines to specify their preferred GL flavour this can be
# automatically adapted.
EXTRA_OECONF += "ac_cv_header_GL_gl_h=no"
ALLOW_EMPTY_${PN} = "1"
ALLOW_EMPTY_${PN}-apps = "1"
ALLOW_EMPTY_${PN}-glib = "1"

View File

@ -0,0 +1,33 @@
From 12d18fe4e98e7c232d59b56d529a0521f293fe6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Wed, 5 Sep 2012 18:54:42 +0200
Subject: [PATCH] v4l2: fix build with recent kernels, the v4l2_buffer input
field was removed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Backport
[1] http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=9f2aa8d47f835ea155aaf635f618c0fc1ca87012
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
sys/v4l2/gstv4l2bufferpool.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
index b81c6a4..51cc0ce 100644
--- a/sys/v4l2/gstv4l2bufferpool.c
+++ b/sys/v4l2/gstv4l2bufferpool.c
@@ -181,7 +181,6 @@ gst_v4l2_buffer_new (GstV4l2BufferPool * pool, guint index, GstCaps * caps)
GST_LOG_OBJECT (pool->v4l2elem, " MMAP offset: %u",
ret->vbuffer.m.offset);
GST_LOG_OBJECT (pool->v4l2elem, " length: %u", ret->vbuffer.length);
- GST_LOG_OBJECT (pool->v4l2elem, " input: %u", ret->vbuffer.input);
data = (guint8 *) v4l2_mmap (0, ret->vbuffer.length,
PROT_READ | PROT_WRITE, MAP_SHARED, pool->video_fd,
--
1.7.6.5

View File

@ -0,0 +1,45 @@
From ccb01de8096a32d86d47b0d92ec3416c57ee4d25 Mon Sep 17 00:00:00 2001
From: Bruce Ashfield <bruce.ashfield@windriver.com>
Date: Thu, 22 Aug 2013 12:15:54 -0400
Subject: [PATCH] v4l2_calls: define V4L2_CID_HCENTER and V4L2_CID_VCENTER
kernel commit 24b9f5017 [[media] V4L: Remove deprecated image centering controls]
removed the definitions of V4L2_CID_HCENTER and V4L2_CID_VCENTER after three
years of depreciation.
The ioctl values are still free, and the case statement which processess them
in v4l2 userspace falls through to the proper replacement. So in the short
term, we can explicitly define them using the old absolute values, and everything
will work.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---
sys/v4l2/v4l2_calls.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
index 309bfb6..3c64544 100644
--- a/sys/v4l2/v4l2_calls.c
+++ b/sys/v4l2/v4l2_calls.c
@@ -54,11 +54,16 @@
#include "gst/gst-i18n-plugin.h"
/* Those are ioctl calls */
+
+/* V4L2_CID_HCENTER has been removed from the mainline kernel, but
+ the ioctl space is still present. Since these values fall through
+ to their replacement, it is safe (in the short term) to re-use the
+ old values explictily */
#ifndef V4L2_CID_HCENTER
-#define V4L2_CID_HCENTER V4L2_CID_HCENTER_DEPRECATED
+#define V4L2_CID_HCENTER V4L2_CID_BASE+22
#endif
#ifndef V4L2_CID_VCENTER
-#define V4L2_CID_VCENTER V4L2_CID_VCENTER_DEPRECATED
+#define V4L2_CID_VCENTER V4L2_CID_BASE+23
#endif
GST_DEBUG_CATEGORY_EXTERN (v4l2_debug);
--
1.7.10.4

View File

@ -0,0 +1,47 @@
From ce94b2c2b91b6db190c121860e12a6afafce7ae1 Mon Sep 17 00:00:00 2001
From: Roland Krikava <rkrikava@gmail.com>
Date: Fri, 2 Nov 2012 12:38:44 -0400
Subject: [PATCH 407/440] mulawdec: fix integer overrun
There might be more than 65535 samples in a chunk of data.
https://bugzilla.gnome.org/show_bug.cgi?id=687469
Commit - 3be45f70220310ec1c60d819f90b5f2ae03b5d83 in 0.10 branch
Upstream Status: Backported
Signed-off-by: Roland Krikava <rkrikava@gmail.com>
---
gst/law/mulaw-conversion.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gst/law/mulaw-conversion.c b/gst/law/mulaw-conversion.c
index 8afae80..190a9f5 100644
--- a/gst/law/mulaw-conversion.c
+++ b/gst/law/mulaw-conversion.c
@@ -51,9 +51,10 @@ mulaw_encode (gint16 * in, guint8 * out, gint numsamples)
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
};
- gint16 sign, exponent, mantissa, i;
+ gint16 sign, exponent, mantissa;
gint16 sample;
guint8 ulawbyte;
+ gint i;
for (i = 0; i < numsamples; i++) {
sample = in[i];
@@ -102,7 +103,8 @@ mulaw_decode (guint8 * in, gint16 * out, gint numsamples)
static gint16 exp_lut[8] = { 0, 132, 396, 924, 1980, 4092, 8316, 16764 };
gint16 sign, exponent, mantissa;
guint8 ulawbyte;
- gint16 linear, i;
+ gint16 linear;
+ gint i;
for (i = 0; i < numsamples; i++) {
ulawbyte = in[i];
--
1.7.9.5

View File

@ -0,0 +1,47 @@
require gst-plugins.inc
LICENSE = "GPLv2+ & LGPLv2.1+"
LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=622921ffad8cb18ab906c56052788a3f \
file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
PR = "r8"
PACKAGECONFIG ?= "jpeg v4l \
${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
"
PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
PACKAGECONFIG[wavpack] = "--enable-wavpack,--disable-wavpack,wavpack"
PACKAGECONFIG[gdkpixbuf] = "--enable-gdk_pixbuf,--disable-gdk_pixbuf,gdk-pixbuf"
PACKAGECONFIG[v4l] = "--enable-gst_v4l2 --with-gudev,--disable-gst_v4l2 --without-gudev,udev"
# sub-feature of v4l, but control separately since libv4l is not part of oe-core
PACKAGECONFIG[libv4l] = "--with-libv4l2,--without-libv4l2,libv4l"
PACKAGECONFIG[bzip2] = "--enable-bz2,--disable-bz2,bzip2"
PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc"
PACKAGECONFIG[x11] = "--enable-x,--disable-x,virtual/libx11 libxfixes libxdamage"
DEPENDS += "gst-plugins-base gconf cairo libpng zlib libid3tag flac \
speex libsoup-2.4 libcap"
inherit gettext gconf
SRC_URI += "file://0001-v4l2-fix-build-with-recent-kernels-the-v4l2_buffer-i.patch \
file://0001-v4l2_calls-define-V4L2_CID_HCENTER-and-V4L2_CID_VCEN.patch \
file://0407-mulawdec-fix-integer-overrun.patch \
"
EXTRA_OECONF += "--disable-aalib --disable-esd --disable-shout2 --disable-libcaca --disable-hal \
--disable-examples --disable-taglib"
do_configure_prepend() {
# This m4 file contains nastiness which conflicts with libtool 2.2.2
rm ${S}/m4/lib-link.m4 || true
}
SRC_URI[md5sum] = "24f98a294a2b521e1b29412bdadae2e6"
SRC_URI[sha256sum] = "7e27840e40a7932ef2dc032d7201f9f41afcaf0b437daf5d1d44dc96d9e35ac6"
FILES_${PN}-gconfelements += "${sysconfdir}/gconf/schemas/gstreamer-0.10.schemas"
FILES_${PN}-equalizer += "${datadir}/gstreamer-0.10/presets/*.prs"

View File

@ -0,0 +1,29 @@
require gst-plugins.inc
LICENSE = "GPLv2+ & LGPLv2.1+ & LGPLv2+"
LICENSE_FLAGS = "commercial"
LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://gst/synaesthesia/synaescope.h;beginline=1;endline=20;md5=99f301df7b80490c6ff8305fcc712838 \
file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068 \
file://gst/mpegstream/gstmpegparse.h;beginline=1;endline=18;md5=ff65467b0c53cdfa98d0684c1bc240a9"
DEPENDS += "gst-plugins-base libid3tag libmad mpeg2dec liba52 lame"
PR = "r3"
inherit gettext
EXTRA_OECONF += "--with-plugins=a52dec,lame,id3tag,mad,mpeg2dec,mpegstream,mpegaudioparse,asfdemux,realmedia \
--disable-orc"
PACKAGECONFIG ??= ""
PACKAGECONFIG[x264] = "--enable-x264,--disable-x264,x264"
PACKAGECONFIG[cdio] = "--enable-cdio,--disable-cdio,libcdio"
PACKAGECONFIG[dvdread] = "--enable-dvdread,--disable-dvdread,libdvdread"
do_configure_prepend() {
# This m4 file contains nastiness which conflicts with libtool 2.2.2
rm ${S}/m4/lib-link.m4 || true
}
SRC_URI[md5sum] = "1d81c593e22a6cdf0f2b4f57eae93df2"
SRC_URI[sha256sum] = "1ca90059275c0f5dca71d4d1601a8f429b7852baed0723e820703b977e2c8df0"

View File

@ -0,0 +1,28 @@
SUMMARY = "Plugins for the GStreamer multimedia framework"
HOMEPAGE = "http://gstreamer.freedesktop.org/"
BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
SECTION = "multimedia"
DEPENDS = "gstreamer"
inherit autotools pkgconfig
SRC_URI = "http://gstreamer.freedesktop.org/src/${BPN}/${BPN}-${PV}.tar.bz2"
GSTREAMER_DEBUG ?= "--disable-debug"
EXTRA_OECONF = "--disable-valgrind ${GSTREAMER_DEBUG} --disable-examples "
acpaths = "-I ${S}/common/m4 -I ${S}/m4"
LIBV = "0.10"
require recipes-multimedia/gstreamer/gst-plugins-package.inc
PACKAGES_DYNAMIC += "^${PN}-.*"
# apply gstreamer hack after Makefile.in.in in source is replaced by our version from
# ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in, but before configure is executed
# http://lists.linuxtogo.org/pipermail/openembedded-core/2012-November/032233.html
oe_runconf_prepend() {
if [ -e ${S}/po/Makefile.in.in ]; then
sed -i -e "1a\\" -e 'GETTEXT_PACKAGE = @GETTEXT_PACKAGE@' ${S}/po/Makefile.in.in
fi
}

View File

@ -0,0 +1,32 @@
From ed7f4802222234eef192aa3f74bc92268f338f97 Mon Sep 17 00:00:00 2001
From: Sebastian Droege <sebastian.droege@collabora.co.uk>
Date: Tue, 6 Mar 2012 12:28:02 +0100
Subject: [PATCH] baseparse: Fix 'self-comparison always evaluates to true'
This was really a bug.
Commit is ed7f4802222234eef192aa3f74bc92268f338f97 in 0.10 branch
Upstream Status: Backported
Signed-off-by: Sebastian Droege <sebastian.droege@collabora.co.uk>
---
libs/gst/base/gstbaseparse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c
index 851ec1d..108ee89 100644
--- a/libs/gst/base/gstbaseparse.c
+++ b/libs/gst/base/gstbaseparse.c
@@ -3899,7 +3899,7 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event)
seek event (in bytes) to upstream. Segment / flush handling happens
in corresponding src event handlers */
GST_DEBUG_OBJECT (parse, "seek in PUSH mode");
- if (seekstop >= 0 && seekpos <= seekpos)
+ if (seekstop >= 0 && seekstop <= seekpos)
seekstop = seekpos;
new_event = gst_event_new_seek (rate, GST_FORMAT_BYTES, flags,
GST_SEEK_TYPE_SET, seekpos, stop_type, seekstop);
--
1.7.9.5

View File

@ -0,0 +1,19 @@
# gstreamer: Fix a problem with configure if check has already been built
# Richard Purdie <rpurdie@linux.intel.com>
Upstream-Status: Inappropriate [configuration]
diff -urN gstreamer-0.10.29-orig/configure.ac gstreamer-0.10.29/configure.ac
--- gstreamer-0.10.29-orig/configure.ac 2010-06-26 12:49:27.774930773 +0800
+++ gstreamer-0.10.29/configure.ac 2010-06-26 12:51:12.899200233 +0800
@@ -543,8 +543,10 @@
*) BUILD_CHECK=yes ;;
esac
])
+
dnl bit of a misnomer, but keep the conditional named like this so we don't
dnl have to change too much elsewhere
+HAVE_CHECK=no
AM_CONDITIONAL(HAVE_CHECK, test "x$BUILD_CHECK" = "xyes")
dnl configure the desired buffer alignment

View File

@ -0,0 +1,16 @@
# Fix crash with gst-inspect
# Chris Lord <chris@openedhand.com>
Upstream-Status: Pending
--- gstreamer-0.10.9/tools/gst-inspect.c.old 2006-09-12 11:56:53.000000000 +0100
+++ gstreamer-0.10.9/tools/gst-inspect.c 2006-09-12 11:57:27.000000000 +0100
@@ -1123,7 +1123,7 @@
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
g_option_context_add_group (ctx, gst_init_get_option_group ());
if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
- g_print ("Error initializing: %s\n", err->message);
+ g_print ("Error initializing: %s\n", err ? err->message : "(null)");
exit (1);
}
g_option_context_free (ctx);

View File

@ -0,0 +1,33 @@
gstreamer: change priv_gst_parse_yylex arguments
Change priv_gst_parse_yylex to fit new bison version, else we will
get following error:
| grammar.tab.c: In function 'priv_gst_parse_yyparse':
| grammar.tab.c:67:25: error: too few arguments to function 'priv_gst_parse_yylex'
| #define yylex priv_gst_parse_yylex
| ^
Upstream-Status: Pending
Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
gst/parse/grammar.y | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y
index 24fc87b..24fe906 100644
--- a/gst/parse/grammar.y
+++ b/gst/parse/grammar.y
@@ -36,7 +36,7 @@
typedef void* yyscan_t;
-int priv_gst_parse_yylex (void * yylval_param , yyscan_t yyscanner);
+int priv_gst_parse_yylex (yyscan_t yyscanner);
int priv_gst_parse_yylex_init (yyscan_t scanner);
int priv_gst_parse_yylex_destroy (yyscan_t scanner);
struct yy_buffer_state * priv_gst_parse_yy_scan_string (char* , yyscan_t);
--
1.9.1

View File

@ -0,0 +1,487 @@
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
* 2005 David A. Schleef <ds@schleef.org>
*
* gstregistryxml.c: GstRegistry object, support routines
*
* This library is free software; you can redistribute it and/or
* modify it ulnder the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <gst/gstregistrybinary.h>
/*
** Simple handy function to write a memory location to the registry cache file
*/
inline static gboolean
gst_registry_binary_write(GstRegistry *registry, const void *mem, const ssize_t size)
{
if (write(registry->cache_file, mem, size) != size)
{
GST_ERROR("Failed to write binary registry element: ptr=%p size=%u error=%s\n",
mem, size, strerror(errno));
return FALSE;
}
return TRUE;
}
/*
** Save features GstBinary style
*/
static gboolean
gst_registry_binary_fill_feature(GList **list, GstPluginFeature *orig, GstBinaryPluginFeature *dest, const char *name)
{
GstBinaryChunck *chk;
if ((chk = calloc(1, sizeof (GstBinaryChunck))) == NULL)
return FALSE;
chk->data = dest;
chk->size = sizeof (GstBinaryPluginFeature);
*list = g_list_append(*list, chk);
dest->rank = orig->rank;
if (!strncpy(dest->typename, name, GST_BINARY_REGISTRY_TYPENAME_TYPENAME_LEN) ||
!strncpy(dest->name, orig->name, GST_BINARY_REGISTRY_TYPENAME_NAME_LEN))
{
GST_ERROR("Failed to write binary registry feature");
goto fail;
}
if (GST_IS_ELEMENT_FACTORY(orig))
{
GstElementFactory *factory = GST_ELEMENT_FACTORY(orig);
if (!strncpy(dest->longname, factory->details.longname, GST_BINARY_REGISTRY_TYPENAME_LONGNAME_LEN) ||
!strncpy(dest->class, factory->details.klass, GST_BINARY_REGISTRY_TYPENAME_CLASS_LEN) ||
!strncpy(dest->description, factory->details.description, GST_BINARY_REGISTRY_TYPENAME_DESCRIPTION_LEN) ||
!strncpy(dest->author, factory->details.author, GST_BINARY_REGISTRY_TYPENAME_AUTHOR_LEN))
{
GST_ERROR("Failed to write binary registry feature");
goto fail;
}
}
dest->npadtemplates = dest->ninterfaces = dest->nuritypes = 0;
return TRUE;
fail:
free(chk);
return FALSE;
}
/*
** Initialize the GstBinaryRegistryMagic, setting both our magic number and gstreamer major/minor version
*/
inline static gboolean
gst_registry_binary_initialize_magic(GstBinaryRegistryMagic *m)
{
if (!strncpy(m->magic, GST_MAGIC_BINARY_REGISTRY_STR, GST_MAGIC_BINARY_REGISTRY_LEN) ||
!strncpy(m->version, GST_MAJORMINOR, GST_BINARY_REGISTRY_VERSION_LEN))
{
GST_ERROR("Failed to write magic to the registry magic structure");
return FALSE;
}
return TRUE;
}
/*
** Check GstBinaryRegistryMagic validity.
** Return a pointer pointing right after the magic structure
*/
static gchar *
gst_registry_binary_check_magic(gchar *in)
{
GstBinaryRegistryMagic *m = (GstBinaryRegistryMagic *) in;
if (m == NULL || m->magic == NULL || m->version == NULL)
{
GST_ERROR("Binary registry magic structure is broken");
return NULL;
}
if (strncmp(m->magic, GST_MAGIC_BINARY_REGISTRY_STR, GST_MAGIC_BINARY_REGISTRY_LEN) != 0)
{
GST_ERROR("Binary registry magic is different : %02x%02x%02x%02x != %02x%02x%02x%02x",
GST_MAGIC_BINARY_REGISTRY_STR[0] & 0xff, GST_MAGIC_BINARY_REGISTRY_STR[1] & 0xff,
GST_MAGIC_BINARY_REGISTRY_STR[2] & 0xff, GST_MAGIC_BINARY_REGISTRY_STR[3] & 0xff,
m->magic[0] & 0xff, m->magic[1] & 0xff, m->magic[2] & 0xff, m->magic[3] & 0xff);
return NULL;
}
if (strncmp(m->version, GST_MAJORMINOR, GST_BINARY_REGISTRY_VERSION_LEN))
{
GST_ERROR("Binary registry magic version is different : %s != %s",
GST_MAJORMINOR, m->version);
return NULL;
}
return (in + sizeof (GstBinaryRegistryMagic));
}
/*
** Adapt a GstPlugin to our GstBinaryPluginElement structure, and write it to the
** registry file.
*/
static gboolean
gst_registry_binary_save_plugin(GList **list, GstRegistry *registry, GstPlugin *plugin)
{
GstBinaryPluginElement *e;
GstBinaryChunck *chk;
GList *walk;
if ((e = calloc(1, sizeof (GstBinaryPluginElement))) == NULL ||
(chk = calloc(1, sizeof (GstBinaryChunck))) == NULL)
return FALSE;
chk->data = e;
chk->size = sizeof (GstBinaryPluginElement);
*list = g_list_append(*list, chk);
if (!strncpy(e->name, plugin->desc.name, GST_BINARY_REGISTRY_NAME_LEN) ||
!strncpy(e->description, plugin->desc.description, GST_BINARY_REGISTRY_DESCRIPTION_LEN) ||
!strncpy(e->filename, plugin->filename, _POSIX_PATH_MAX) ||
!strncpy(e->version, plugin->desc.version, GST_BINARY_REGISTRY_VERSION_LEN) ||
!strncpy(e->license, plugin->desc.license, GST_BINARY_REGISTRY_LICENSE_LEN) ||
!strncpy(e->source, plugin->desc.source, GST_BINARY_REGISTRY_SOURCE_LEN) ||
!strncpy(e->package, plugin->desc.package, GST_BINARY_REGISTRY_PACKAGE_LEN) ||
!strncpy(e->origin, plugin->desc.origin, GST_BINARY_REGISTRY_ORIGIN_LEN))
{
GST_DEBUG("Can't adapt GstPlugin to GstBinaryPluginElement");
goto fail;
}
e->size = plugin->file_size;
e->m32p = plugin->file_mtime;
GList *ft_list = gst_registry_get_feature_list_by_plugin(registry, plugin->desc.name);
for (walk = ft_list; walk; walk = g_list_next(walk), e->nfeatures++)
{
GstPluginFeature *curfeat = GST_PLUGIN_FEATURE (walk->data);
GstBinaryPluginFeature *newfeat;
const char *feat_name = g_type_name(G_OBJECT_TYPE(curfeat));
if ((newfeat = calloc(1, sizeof (GstBinaryPluginFeature))) == NULL)
goto fail;
if (!feat_name || !gst_registry_binary_fill_feature(list, curfeat, newfeat, feat_name))
{
GST_ERROR("Can't fill plugin feature, aborting.");
goto fail;
}
}
GST_DEBUG("Found %d features in plugin \"%s\"\n", e->nfeatures, e->name);
return TRUE;
fail:
free(chk);
free(e);
return FALSE;
}
/*
** Write the cache to file. Part of the code was taken from gstregistryxml.c
*/
gboolean
gst_registry_binary_write_cache(GstRegistry *registry, const char *location)
{
GList *walk;
char *tmp_location;
GstBinaryRegistryMagic *magic;
GstBinaryChunck *magic_chunck;
GList *to_write = NULL;
GST_INFO("Writing binary registry cache");
g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
tmp_location = g_strconcat (location, ".tmpXXXXXX", NULL);
registry->cache_file = g_mkstemp (tmp_location);
if (registry->cache_file == -1)
{
char *dir;
/* oops, I bet the directory doesn't exist */
dir = g_path_get_dirname (location);
g_mkdir_with_parents (dir, 0777);
g_free (dir);
registry->cache_file = g_mkstemp (tmp_location);
}
if (registry->cache_file == -1)
goto fail;
if ((magic = calloc(1, sizeof (GstBinaryRegistryMagic))) == NULL ||
!gst_registry_binary_initialize_magic(magic))
goto fail;
if ((magic_chunck = calloc(1, sizeof (GstBinaryChunck))) == NULL)
goto fail;
magic_chunck->data = magic;
magic_chunck->size = sizeof (GstBinaryRegistryMagic);
to_write = g_list_append(to_write, magic_chunck);
/* Iterate trough the list of plugins in the GstRegistry and adapt them to our structures */
for (walk = g_list_last(registry->plugins); walk; walk = g_list_previous(walk))
{
GstPlugin *plugin = GST_PLUGIN(walk->data);
if (!plugin->filename)
continue;
if (plugin->flags & GST_PLUGIN_FLAG_CACHED)
{
int ret;
struct stat statbuf;
ret = g_stat (plugin->filename, &statbuf);
if ((ret = g_stat (plugin->filename, &statbuf)) < 0 ||
plugin->file_mtime != statbuf.st_mtime ||
plugin->file_size != statbuf.st_size)
continue;
}
if (!gst_registry_binary_save_plugin(&to_write, registry, plugin))
{
GST_ERROR("Can't write binary plugin information for \"%s\"", plugin->filename);
continue; /* Try anyway */
}
}
for (walk = g_list_first(to_write); walk; walk = g_list_next(walk))
{
GstBinaryChunck *cur = walk->data;
if (!gst_registry_binary_write(registry, cur->data, cur->size))
{
free(cur->data);
free(cur);
g_list_free(to_write);
goto fail;
}
free(cur->data);
free(cur);
}
g_list_free(to_write);
if (close(registry->cache_file) < 0)
{
GST_DEBUG("Can't close registry file : %s", strerror(errno));
goto fail;
}
if (g_file_test (tmp_location, G_FILE_TEST_EXISTS)) {
#ifdef WIN32
remove (location);
#endif
rename (tmp_location, location);
}
g_free (tmp_location);
return TRUE;
fail:
g_free(tmp_location);
return FALSE;
}
static GstPluginFeature*
gst_registry_binary_load_feature(GstBinaryPluginFeature *in)
{
GstPluginFeature *feature;
GType type;
if (!in->typename || !*(in->typename))
return NULL;
/* GST_INFO("Plugin feature typename : %s", in->typename);*/
if (!(type = g_type_from_name(in->typename)))
{
GST_ERROR("Unknown type from typename");
return NULL;
}
feature = g_object_new (type, NULL);
if (!feature) {
GST_ERROR("Can't create feature from type");
return NULL;
}
if (!GST_IS_PLUGIN_FEATURE (feature)) {
/* don't really know what it is */
if (GST_IS_OBJECT (feature))
gst_object_unref (feature);
else
g_object_unref (feature);
return NULL;
}
feature->name = g_strdup(in->name);
feature->rank = in->rank;
if (GST_IS_ELEMENT_FACTORY(feature))
{
GstElementFactory *factory = GST_ELEMENT_FACTORY(feature);
factory->details.longname = g_strdup(in->longname);
factory->details.klass = g_strdup(in->class);
factory->details.description = g_strdup(in->description);
factory->details.author = g_strdup(in->author);
/* GST_INFO("Element factory : %s", factory->details.longname); */
}
GST_DEBUG("Added feature %p with name %s", feature, feature->name);
return feature;
}
/*
** Make a new plugin from current GstBinaryPluginElement structure
** and save it to the GstRegistry. Return an offset to the next
** GstBinaryPluginElement structure.
*/
static unsigned long
gst_registry_binary_get_binary_plugin(GstRegistry *registry, gchar *in)
{
GstBinaryPluginElement *p = (GstBinaryPluginElement *) in;
GstPlugin *plugin = NULL;
GList *plugin_features = NULL;
GstBinaryPluginFeature *feat;
unsigned int i;
unsigned long offset;
plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
plugin->flags |= GST_PLUGIN_FLAG_CACHED;
plugin->desc.name = g_strdup(p->name);
plugin->desc.description= g_strdup(p->description);
plugin->filename = g_strdup(p->filename);
plugin->desc.version = g_strdup(p->version);
plugin->desc.license = g_strdup(p->license);
plugin->desc.source = g_strdup(p->source);
plugin->desc.package = g_strdup(p->package);
plugin->desc.origin = g_strdup(p->origin);
plugin->file_mtime = p->m32p;
plugin->file_size = p->size;
plugin->basename = g_path_get_basename (plugin->filename);
if (plugin->file_mtime < 0 || plugin->file_size < 0)
{
GST_ERROR("Plugin time or file size is not valid !");
g_free(plugin);
return -1;
}
if (p->nfeatures < 0)
{
GST_ERROR("The number of feature structure is not valid !");
gst_object_unref(plugin);
return -1;
}
for (feat = (GstBinaryPluginFeature *) (in + sizeof (GstBinaryPluginElement)), i = 0;
i < p->nfeatures; i++, feat++)
{
GstPluginFeature *gstfeat;
if ((gstfeat = gst_registry_binary_load_feature(feat)) == NULL)
{
g_list_free(plugin_features);
g_free(plugin);
GST_ERROR("Error while loading binary feature");
return -1;
}
gstfeat->plugin_name = g_strdup(plugin->desc.name);
plugin_features = g_list_prepend(plugin_features, gstfeat);
}
GST_DEBUG("Added plugin \"%s\" to global registry from binary registry", plugin->desc.name);
GList *g;
gst_registry_add_plugin (registry, plugin);
for (g = plugin_features; g; g = g_list_next (g))
gst_registry_add_feature (registry, GST_PLUGIN_FEATURE (g->data));
/* g_list_free(plugin_features); */
offset = sizeof (GstBinaryPluginElement) + p->nfeatures * sizeof (GstBinaryPluginFeature);
return offset;
}
/*
** Read the cache and adapt it to fill GstRegistry
*/
gboolean
gst_registry_binary_read_cache(GstRegistry *registry, const char *location)
{
GMappedFile *mapped = NULL;
GTimer *timer = NULL;
gchar *contents = NULL;
gdouble seconds;
unsigned long offset, inc;
gsize size;
/* make sure these types exist */
GST_TYPE_ELEMENT_FACTORY;
GST_TYPE_TYPE_FIND_FACTORY;
GST_TYPE_INDEX_FACTORY;
timer = g_timer_new ();
if ((mapped = g_mapped_file_new(location, FALSE, NULL)) == NULL ||
(contents = g_mapped_file_get_contents(mapped)) == NULL)
{
GST_ERROR("Can't load file : %s", strerror(errno));
return FALSE;
}
if ((contents = gst_registry_binary_check_magic(contents)) == NULL)
{
GST_ERROR("Binary registry type not recognized (invalid magic)");
g_mapped_file_free(mapped);
return FALSE;
}
if ((size = g_mapped_file_get_length(mapped)) < sizeof (GstBinaryPluginElement))
{
GST_INFO("No binary plugins structure to read");
return TRUE; /* This is not really an error */
}
for (offset = inc = 0; (offset + sizeof (GstBinaryPluginElement)) < size &&
(inc = gst_registry_binary_get_binary_plugin(registry, contents + offset)) > 0;
offset += inc)
; /* May want in the future to do something here */
if (inc < 0)
{
GST_DEBUG("Problem while reading binary registry");
return FALSE;
}
g_timer_stop (timer);
seconds = g_timer_elapsed (timer, NULL);
g_timer_destroy (timer);
GST_INFO ("loaded %s in %f seconds", location, seconds);
if (mapped)
g_mapped_file_free (mapped);
return TRUE;
}

View File

@ -0,0 +1,194 @@
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wim.taymans@chello.be>
*
* gstregistry.h: Header for registry handling
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* SUGGESTIONS AND TODO :
** ====================
** - Use a compressed registry, but would induce performance loss
** - Encrypt the registry, for security purpose, but would also reduce performances
** - Also have a non-mmap based cache reading (work with file descriptors)
*/
#ifndef __GST_REGISTRYBINARY_H__
#define __GST_REGISTRYBINARY_H__
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/mman.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gst/gst_private.h>
#include <gst/gstelement.h>
#include <gst/gsttypefind.h>
#include <gst/gsttypefindfactory.h>
#include <gst/gsturi.h>
#include <gst/gstinfo.h>
#include <gst/gstenumtypes.h>
#include <gst/gstregistry.h>
#include <gst/gstpadtemplate.h>
#include "glib-compat-private.h"
#include <glib/gstdio.h>
/* A magic, written at the beginning of the file */
#define GST_MAGIC_BINARY_REGISTRY_STR "\xc0\xde\xf0\x0d"
#define GST_MAGIC_BINARY_REGISTRY_LEN (4)
#define GST_MAGIC_BINARY_VERSION_LEN (64)
typedef struct _GstBinaryRegistryMagic
{
char magic[GST_MAGIC_BINARY_REGISTRY_LEN];
char version[GST_MAGIC_BINARY_VERSION_LEN];
} GstBinaryRegistryMagic;
/* Used to store pointers to write */
typedef struct _GstBinaryChunck
{
void *data;
unsigned int size;
} GstBinaryChunck;
/* A structure containing (staticely) every information needed for a plugin
**
** Notes :
** "nfeatures" is used to say how many GstBinaryPluginFeature structures we will have
** right after the structure itself.
*/
/* Various lenght defines for our GstBinaryPluginElement structure
** Note : We could eventually use smaller size
*/
#define GST_BINARY_REGISTRY_NAME_LEN (256)
#define GST_BINARY_REGISTRY_DESCRIPTION_LEN (1024)
#define GST_BINARY_REGISTRY_VERSION_LEN (64)
#define GST_BINARY_REGISTRY_LICENSE_LEN (256)
#define GST_BINARY_REGISTRY_SOURCE_LEN (256)
#define GST_BINARY_REGISTRY_PACKAGE_LEN (1024)
#define GST_BINARY_REGISTRY_ORIGIN_LEN (1024)
typedef struct _GstBinaryPluginElement
{
char name[GST_BINARY_REGISTRY_NAME_LEN];
char description[GST_BINARY_REGISTRY_DESCRIPTION_LEN];
char filename[_POSIX_PATH_MAX];
char version[GST_BINARY_REGISTRY_VERSION_LEN];
char license[GST_BINARY_REGISTRY_LICENSE_LEN];
char source[GST_BINARY_REGISTRY_SOURCE_LEN];
char package[GST_BINARY_REGISTRY_PACKAGE_LEN];
char origin[GST_BINARY_REGISTRY_ORIGIN_LEN];
unsigned long size;
unsigned long m32p;
unsigned int nfeatures;
} GstBinaryPluginElement;
/* A structure containing the plugin features
**
** Note :
** "npadtemplates" is used to store the number of GstBinaryPadTemplate structures following the structure itself.
** "ninterfaces" is used to store the number of GstBinaryInterface structures following the structure itself.
** "nuritypes" is used to store the number of GstBinaryUriType structures following the structure itself.
*/
#define GST_BINARY_REGISTRY_TYPENAME_TYPENAME_LEN (256)
#define GST_BINARY_REGISTRY_TYPENAME_NAME_LEN (256)
#define GST_BINARY_REGISTRY_TYPENAME_LONGNAME_LEN (1024)
#define GST_BINARY_REGISTRY_TYPENAME_CLASS_LEN (512)
#define GST_BINARY_REGISTRY_TYPENAME_DESCRIPTION_LEN (1024)
#define GST_BINARY_REGISTRY_TYPENAME_AUTHOR_LEN (256)
typedef struct _GstBinaryPluginFeature
{
char typename[GST_BINARY_REGISTRY_TYPENAME_TYPENAME_LEN];
char name[GST_BINARY_REGISTRY_TYPENAME_NAME_LEN];
unsigned long rank;
char longname[GST_BINARY_REGISTRY_TYPENAME_LONGNAME_LEN];
char class[GST_BINARY_REGISTRY_TYPENAME_CLASS_LEN];
char description[GST_BINARY_REGISTRY_TYPENAME_DESCRIPTION_LEN];
char author[GST_BINARY_REGISTRY_TYPENAME_AUTHOR_LEN];
unsigned int npadtemplates;
unsigned int ninterfaces;
unsigned int nuritypes;
} GstBinaryPluginFeature;
/*
** A structure containing the static pad templates of a plugin feature
*/
#define GST_BINARY_REGISTRY_PADTEMPLATE_NAME_LEN (256)
#define GST_BINARY_REGISTRY_PADTEMPLATE_CAP_LEN (1024)
typedef struct _GstBinaryPadTemplate
{
char name[GST_BINARY_REGISTRY_PADTEMPLATE_NAME_LEN];
char cap[GST_BINARY_REGISTRY_PADTEMPLATE_CAP_LEN];
int direction; /* Either 0:"sink" or 1:"src" */
GstPadPresence presence;
} GstBinaryPadTemplate;
/*
** A very simple structure defining the plugin feature interface string
*/
#define GST_BINARY_REGISTRY_INTERFACE_INTERFACE_LEN (512)
typedef struct _GstBinaryInterface
{
char interface[GST_BINARY_REGISTRY_INTERFACE_INTERFACE_LEN];
unsigned long size;
} GstBinaryInterface;
/* Uri Type */
typedef struct _GstBinaryUriType
{
GstURIType type;
unsigned long nuriprotocols;
} GstBinaryUriType;
/*
** Function prototypes
*/
/* Local prototypes */
inline static gboolean gst_registry_binary_write(GstRegistry *registry, const void *mem, const ssize_t size);
inline static gboolean gst_registry_binary_initialize_magic(GstBinaryRegistryMagic *m);
static gboolean gst_registry_binary_fill_feature(GList **list, GstPluginFeature *, GstBinaryPluginFeature *, const char *);
static gboolean gst_registry_binary_save_plugin(GList **list, GstRegistry *registry, GstPlugin *plugin);
static gchar *gst_registry_binary_check_magic(gchar *in);
static GstPluginFeature *gst_registry_binary_load_feature(GstBinaryPluginFeature *);
static unsigned long gst_registry_binary_get_binary_plugin(GstRegistry *registry, gchar *in);
/* Exportable */
gboolean gst_registry_binary_write_cache(GstRegistry *registry, const char *location);
gboolean gst_registry_binary_read_cache(GstRegistry *registry, const char *location);
#endif /* !__GST_REGISTRYBINARY_H__ */

View File

@ -0,0 +1,51 @@
SUMMARY = "GStreamer multimedia framework"
DESCRIPTION = "GStreamer is a multimedia framework for encoding and decoding video and sound. \
It supports a wide range of formats including mp3, ogg, avi, mpeg and quicktime."
HOMEPAGE = "http://gstreamer.freedesktop.org/"
BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
SECTION = "multimedia"
LICENSE = "LGPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605 \
file://gst/gst.h;beginline=1;endline=21;md5=8e5fe5e87d33a04479fde862e238eaa4"
DEPENDS = "glib-2.0 libxml2 bison-native flex-native"
PR = "r2"
SRC_URI = "http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.bz2 \
file://check_fix.patch \
file://gst-inspect-check-error.patch \
file://0001-baseparse-Fix-self-comparison-always-evaluates-to-tr.patch \
file://gstreamer-change-priv_gst_parse_yylex-arguments.patch \
"
SRC_URI[md5sum] = "a0cf7d6877f694a1a2ad2b4d1ecb890b"
SRC_URI[sha256sum] = "e556a529e0a8cf1cd0afd0cab2af5488c9524e7c3f409de29b5d82bb41ae7a30"
inherit autotools pkgconfig gettext
GSTREAMER_DEBUG ?= "--disable-debug"
EXTRA_OECONF = "--disable-docbook --disable-gtk-doc \
--disable-dependency-tracking --disable-check \
--disable-examples --disable-tests \
--disable-valgrind ${GSTREAMER_DEBUG} \
"
CACHED_CONFIGUREVARS += "ac_cv_header_valgrind_valgrind_h=no"
# apply gstreamer hack after Makefile.in.in in source is replaced by our version from
# ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in, but before configure is executed
# http://lists.linuxtogo.org/pipermail/openembedded-core/2012-November/032233.html
oe_runconf_prepend() {
sed -i -e "1a\\" -e 'GETTEXT_PACKAGE = @GETTEXT_PACKAGE@' ${S}/po/Makefile.in.in
}
#do_compile_prepend () {
# mv ${WORKDIR}/gstregistrybinary.[ch] ${S}/gst/
#}
RRECOMMENDS_${PN}_qemux86 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
RRECOMMENDS_${PN}_qemux86-64 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
FILES_${PN} += " ${libdir}/gstreamer-0.10/*.so"
FILES_${PN}-dev += " ${libdir}/gstreamer-0.10/*.la ${libdir}/gstreamer-0.10/*.a"
FILES_${PN}-dbg += " ${libdir}/gstreamer-0.10/.debug/ ${libexecdir}/gstreamer-0.10/.debug/"