[FFmpeg-cvslog] avcodec: Fix a doxy comment to refer to the right function
ffmpeg | branch: master | Martin Storsjö mar...@martin.st | Wed Sep 24 23:31:43 2014 +0300| [d07ddc93e29a4fdf12cd426953a7ecd5abe5e36d] | committer: Martin Storsjö avcodec: Fix a doxy comment to refer to the right function CC: libav-sta...@libav.org Signed-off-by: Martin Storsjö mar...@martin.st http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d07ddc93e29a4fdf12cd426953a7ecd5abe5e36d --- libavcodec/avcodec.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 253e45a..bc5f134 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -473,7 +473,7 @@ enum AVCodecID { /** * This struct describes the properties of a single codec described by an * AVCodecID. - * @see avcodec_get_descriptor() + * @see avcodec_descriptor_get() */ typedef struct AVCodecDescriptor { enum AVCodecID id; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'd07ddc93e29a4fdf12cd426953a7ecd5abe5e36d'
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Thu Sep 25 12:09:09 2014 +0200| [a6fd685fedb1e9f66f9fb2ffdbb7f506e17cf225] | committer: Michael Niedermayer Merge commit 'd07ddc93e29a4fdf12cd426953a7ecd5abe5e36d' * commit 'd07ddc93e29a4fdf12cd426953a7ecd5abe5e36d': avcodec: Fix a doxy comment to refer to the right function Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a6fd685fedb1e9f66f9fb2ffdbb7f506e17cf225 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '28f5cd312c9da9072108edf8b7685d009374ea96'
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Thu Sep 25 13:10:00 2014 +0200| [9b53691f731870220d432ec3304bcc5f744c3c96] | committer: Michael Niedermayer Merge commit '28f5cd312c9da9072108edf8b7685d009374ea96' * commit '28f5cd312c9da9072108edf8b7685d009374ea96': fate: Switch ra4-288 test from framecrc() to pcm() Conflicts: tests/fate/real.mak The test is kept disabled as it still does not pass on x86-64 due to float rounding Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b53691f731870220d432ec3304bcc5f744c3c96 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fate: Switch ra4-288 test from framecrc() to pcm()
ffmpeg | branch: master | Katerina Barone-Adesi kateri...@gmail.com | Wed Sep 24 13:51:54 2014 +0200| [28f5cd312c9da9072108edf8b7685d009374ea96] | committer: Diego Biurrun fate: Switch ra4-288 test from framecrc() to pcm() The decoder is float-based and the test needs to allow for some fuzz. Signed-off-by: Diego Biurrun di...@biurrun.de http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=28f5cd312c9da9072108edf8b7685d009374ea96 --- tests/fate/real.mak|4 ++- tests/ref/fate/ra4-288 | 73 2 files changed, 3 insertions(+), 74 deletions(-) diff --git a/tests/fate/real.mak b/tests/fate/real.mak index 2ad974c..f119ce9 100644 --- a/tests/fate/real.mak +++ b/tests/fate/real.mak @@ -2,7 +2,9 @@ FATE_REALAUDIO-$(call DEMDEC, RM, RA_144) += fate-ra3-144 fate-ra3-144: CMD = framecrc -i $(TARGET_SAMPLES)/realaudio/ra3.ra FATE_REALAUDIO-$(call DEMDEC, RM, RA_288) += fate-ra4-288 -fate-ra4-288: CMD = framecrc -i $(TARGET_SAMPLES)/realaudio/ra4-288.ra +fate-ra4-288: CMD = pcm -i $(TARGET_SAMPLES)/realaudio/ra4_288.ra +fate-ra4-288: REF = $(SAMPLES)/realaudio/ra4_288.pcm +fate-ra4-288: CMP = oneoff FATE_REALMEDIA_AUDIO-$(call DEMDEC, RM, RA_144) += fate-ra-144 fate-ra-144: CMD = md5 -i $(TARGET_SAMPLES)/real/ra3_in_rm_file.rm -f s16le diff --git a/tests/ref/fate/ra4-288 b/tests/ref/fate/ra4-288 deleted file mode 100644 index 6c0bde0..000 --- a/tests/ref/fate/ra4-288 +++ /dev/null @@ -1,73 +0,0 @@ -#tb 0: 1/8000 -0, 0, 0, 160, 320, 0x83a99ec9 -0,160,160, 160, 320, 0xa5a49c69 -0,320,320, 160, 320, 0xda1f901c -0,480,480, 160, 320, 0xf9fca0a2 -0,640,640, 160, 320, 0x04b1899f -0,800,800, 160, 320, 0x67129bd1 -0,960,960, 160, 320, 0x64cd92ee -0, 1120, 1120, 160, 320, 0x4e1498ae -0, 1280, 1280, 160, 320, 0x644891ca -0, 1440, 1440, 160, 320, 0x8cc8bd5b -0, 1600, 1600, 160, 320, 0x5990a0e0 -0, 1760, 1760, 160, 320, 0x3225a08c -0, 1920, 1920, 160, 320, 0x7c9497e9 -0, 2080, 2080, 160, 320, 0xeb9a9ad4 -0, 2240, 2240, 160, 320, 0xabf39ee9 -0, 2400, 2400, 160, 320, 0x2f707823 -0, 2560, 2560, 160, 320, 0xae65756e -0, 2720, 2720, 160, 320, 0x9eea56c6 -0, 2880, 2880, 160, 320, 0x5f0c6bf8 -0, 3040, 3040, 160, 320, 0xfc266273 -0, 3200, 3200, 160, 320, 0x0b76731a -0, 3360, 3360, 160, 320, 0xce856cf9 -0, 3520, 3520, 160, 320, 0x560e7bf0 -0, 3680, 3680, 160, 320, 0x36216c8c -0, 3840, 3840, 160, 320, 0x6ed861e3 -0, 4000, 4000, 160, 320, 0xc58b64f9 -0, 4160, 4160, 160, 320, 0xf4c268e2 -0, 4320, 4320, 160, 320, 0xbae571c9 -0, 4480, 4480, 160, 320, 0x6c087b48 -0, 4640, 4640, 160, 320, 0x119c61cf -0, 4800, 4800, 160, 320, 0x7c646ee0 -0, 4960, 4960, 160, 320, 0x205268f0 -0, 5120, 5120, 160, 320, 0x153e88b2 -0, 5280, 5280, 160, 320, 0x8067642d -0, 5440, 5440, 160, 320, 0x24ae76cd -0, 5600, 5600, 160, 320, 0x1f0761fe -0, 5760, 5760, 160, 320, 0x223179ff -0, 5920, 5920, 160, 320, 0x583370ad -0, 6080, 6080, 160, 320, 0x9f848dff -0, 6240, 6240, 160, 320, 0x987b5ede -0, 6400, 6400, 160, 320, 0x558989d5 -0, 6560, 6560, 160, 320, 0xa3924fb3 -0, 6720, 6720, 160, 320, 0x5c9091a8 -0, 6880, 6880, 160, 320, 0xaf49572f -0, 7040, 7040, 160, 320, 0x08437d3a -0, 7200, 7200, 160, 320, 0xbd429782 -0, 7360, 7360, 160, 320, 0x284c8912 -0, 7520, 7520, 160, 320, 0xa0648204 -0, 7680, 7680, 160, 320, 0x2ad2a3d7 -0, 7840, 7840, 160, 320, 0x7d9087c3 -0, 8000, 8000, 160, 320, 0xf01f8d06 -0, 8160, 8160, 160, 320, 0x644387a1 -0, 8320, 8320, 160, 320, 0x3587817a -0, 8480, 8480, 160, 320, 0x8f579af9 -0, 8640, 8640, 160, 320, 0x4d3596e7 -0, 8800, 8800, 160, 320, 0x13f19284 -0, 8960, 8960, 160, 320, 0x6d0b9211 -0, 9120, 9120, 160, 320, 0x8c439e9e -0, 9280, 9280, 160, 320, 0xac89b376 -0,
[FFmpeg-cvslog] Merge commit '95d312d6c82e7485f43c3ddda0f369af0e41c83b'
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Thu Sep 25 13:45:25 2014 +0200| [8f3d3e5f8373d64f4b05dd1908c048dc0e49e21f] | committer: Michael Niedermayer Merge commit '95d312d6c82e7485f43c3ddda0f369af0e41c83b' * commit '95d312d6c82e7485f43c3ddda0f369af0e41c83b': concat: KR formatting cosmetics Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8f3d3e5f8373d64f4b05dd1908c048dc0e49e21f --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] concat: KR formatting cosmetics
ffmpeg | branch: master | Gabriel Dume gabriel.dd...@gmail.com | Tue Sep 23 10:29:57 2014 -0400| [95d312d6c82e7485f43c3ddda0f369af0e41c83b] | committer: Diego Biurrun concat: KR formatting cosmetics Signed-off-by: Diego Biurrun di...@biurrun.de http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=95d312d6c82e7485f43c3ddda0f369af0e41c83b --- libavformat/concat.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/libavformat/concat.c b/libavformat/concat.c index 416bbf5..2fb3ba9 100644 --- a/libavformat/concat.c +++ b/libavformat/concat.c @@ -21,9 +21,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include avformat.h #include libavutil/avstring.h #include libavutil/mem.h + +#include avformat.h #include url.h #define AV_CAT_SEPARATOR | @@ -59,24 +60,26 @@ static av_cold int concat_open(URLContext *h, const char *uri, int flags) char *node_uri = NULL; int err = 0; int64_t size; -size_t len, i; +size_t len, i; URLContext *uc; struct concat_data *data = h-priv_data; struct concat_nodes *nodes; av_strstart(uri, concat:, uri); -for (i = 0, len = 1; uri[i]; i++) -if (uri[i] == *AV_CAT_SEPARATOR) +for (i = 0, len = 1; uri[i]; i++) { +if (uri[i] == *AV_CAT_SEPARATOR) { /* integer overflow */ if (++len == UINT_MAX / sizeof(*nodes)) { av_freep(h-priv_data); return AVERROR(ENAMETOOLONG); } +} +} -if (!(nodes = av_realloc(NULL, sizeof(*nodes) * len))) { +if (!(nodes = av_realloc(NULL, sizeof(*nodes) * len))) return AVERROR(ENOMEM); -} else +else data-nodes = nodes; /* handle input */ @@ -87,8 +90,8 @@ static av_cold int concat_open(URLContext *h, const char *uri, int flags) len = strcspn(uri, AV_CAT_SEPARATOR); if ((err = av_reallocp(node_uri, len + 1)) 0) break; -av_strlcpy(node_uri, uri, len+1); -uri += len + strspn(uri+len, AV_CAT_SEPARATOR); +av_strlcpy(node_uri, uri, len + 1); +uri += len + strspn(uri + len, AV_CAT_SEPARATOR); /* creating URLContext */ if ((err = ffurl_open(uc, node_uri, flags, @@ -123,16 +126,17 @@ static int concat_read(URLContext *h, unsigned char *buf, int size) int result, total = 0; struct concat_data *data = h-priv_data; struct concat_nodes *nodes = data-nodes; -size_t i = data-current; +size_t i = data-current; while (size 0) { result = ffurl_read(nodes[i].uc, buf, size); if (result 0) return total ? total : result; -if (!result) +if (!result) { if (i + 1 == data-length || ffurl_seek(nodes[++i].uc, 0, SEEK_SET) 0) break; +} total += result; buf += result; size -= result; @@ -150,9 +154,7 @@ static int64_t concat_seek(URLContext *h, int64_t pos, int whence) switch (whence) { case SEEK_END: -for (i = data-length - 1; - i pos -nodes[i].size; - i--) +for (i = data-length - 1; i pos -nodes[i].size; i--) pos += nodes[i].size; break; case SEEK_CUR: ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lmlm4: KR formatting cosmetics
ffmpeg | branch: master | Gabriel Dume gabriel.dd...@gmail.com | Tue Sep 23 10:29:58 2014 -0400| [86a361081d3eb4e999d75bc2a462f01d88cbd2e5] | committer: Diego Biurrun lmlm4: KR formatting cosmetics Signed-off-by: Diego Biurrun di...@biurrun.de http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=86a361081d3eb4e999d75bc2a462f01d88cbd2e5 --- libavformat/lmlm4.c | 37 - 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/libavformat/lmlm4.c b/libavformat/lmlm4.c index b67b68e..1fb03e7 100644 --- a/libavformat/lmlm4.c +++ b/libavformat/lmlm4.c @@ -23,6 +23,7 @@ */ #include libavutil/intreadwrite.h + #include avformat.h #include internal.h @@ -34,23 +35,23 @@ #define LMLM4_MAX_PACKET_SIZE 1024 * 1024 -static int lmlm4_probe(AVProbeData * pd) { +static int lmlm4_probe(AVProbeData *pd) +{ unsigned char *buf = pd-buf; unsigned int frame_type, packet_size; -frame_type = AV_RB16(buf+2); -packet_size = AV_RB32(buf+4); +frame_type = AV_RB16(buf + 2); +packet_size = AV_RB32(buf + 4); if (!AV_RB16(buf) frame_type = LMLM4_MPEG1L2 packet_size frame_type != LMLM4_INVALID packet_size = LMLM4_MAX_PACKET_SIZE) { - if (frame_type == LMLM4_MPEG1L2) { -if ((AV_RB16(buf+8) 0xfffe) != 0xfffc) +if ((AV_RB16(buf + 8) 0xfffe) != 0xfffc) return 0; /* I could calculate the audio framesize and compare with * packet_size-8, but that seems overkill */ return AVPROBE_SCORE_MAX / 3; -} else if (AV_RB24(buf+8) == 0x01) {/* PES Signal */ +} else if (AV_RB24(buf + 8) == 0x01) {/* PES Signal */ return AVPROBE_SCORE_MAX / 5; } } @@ -58,7 +59,8 @@ static int lmlm4_probe(AVProbeData * pd) { return 0; } -static int lmlm4_read_header(AVFormatContext *s) { +static int lmlm4_read_header(AVFormatContext *s) +{ AVStream *st; if (!(st = avformat_new_stream(s, NULL))) @@ -78,7 +80,8 @@ static int lmlm4_read_header(AVFormatContext *s) { return 0; } -static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) { +static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) +{ AVIOContext *pb = s-pb; int ret; unsigned int frame_type, packet_size, padding, frame_size; @@ -104,15 +107,15 @@ static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) { avio_skip(pb, padding); switch (frame_type) { -case LMLM4_I_FRAME: -pkt-flags = AV_PKT_FLAG_KEY; -case LMLM4_P_FRAME: -case LMLM4_B_FRAME: -pkt-stream_index = 0; -break; -case LMLM4_MPEG1L2: -pkt-stream_index = 1; -break; +case LMLM4_I_FRAME: +pkt-flags = AV_PKT_FLAG_KEY; +case LMLM4_P_FRAME: +case LMLM4_B_FRAME: +pkt-stream_index = 0; +break; +case LMLM4_MPEG1L2: +pkt-stream_index = 1; +break; } return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '86a361081d3eb4e999d75bc2a462f01d88cbd2e5'
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Thu Sep 25 13:51:43 2014 +0200| [59f49667569b5d92a7713b6db75a9e6bfa939079] | committer: Michael Niedermayer Merge commit '86a361081d3eb4e999d75bc2a462f01d88cbd2e5' * commit '86a361081d3eb4e999d75bc2a462f01d88cbd2e5': lmlm4: KR formatting cosmetics Conflicts: libavformat/lmlm4.c Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=59f49667569b5d92a7713b6db75a9e6bfa939079 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '4620affa24eedb167482198aa04126bcedd05620'
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Thu Sep 25 14:02:55 2014 +0200| [454f98b881fc18c553d56371ac0cd1e703e52571] | committer: Michael Niedermayer Merge commit '4620affa24eedb167482198aa04126bcedd05620' * commit '4620affa24eedb167482198aa04126bcedd05620': m4vdec: KR formatting cosmetics Conflicts: libavformat/m4vdec.c Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=454f98b881fc18c553d56371ac0cd1e703e52571 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] m4vdec: KR formatting cosmetics
ffmpeg | branch: master | Gabriel Dume gabriel.dd...@gmail.com | Tue Sep 23 10:29:59 2014 -0400| [4620affa24eedb167482198aa04126bcedd05620] | committer: Diego Biurrun m4vdec: KR formatting cosmetics Signed-off-by: Diego Biurrun di...@biurrun.de http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4620affa24eedb167482198aa04126bcedd05620 --- libavformat/m4vdec.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/libavformat/m4vdec.c b/libavformat/m4vdec.c index 04bd062..4a0af3c 100644 --- a/libavformat/m4vdec.c +++ b/libavformat/m4vdec.c @@ -27,26 +27,32 @@ static int mpeg4video_probe(AVProbeData *probe_packet) { -uint32_t temp_buffer= -1; -int VO=0, VOL=0, VOP = 0, VISO = 0, res=0; +uint32_t temp_buffer = -1; +int VO = 0, VOL = 0, VOP = 0, VISO = 0, res = 0; int i; -for(i=0; iprobe_packet-buf_size; i++){ -temp_buffer = (temp_buffer8) + probe_packet-buf[i]; +for (i = 0; i probe_packet-buf_size; i++) { +temp_buffer = (temp_buffer 8) + probe_packet-buf[i]; if ((temp_buffer 0xff00) != 0x100) continue; -if (temp_buffer == VOP_START_CODE) VOP++; -else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++; -else if (temp_buffer 0x120) VO++; -else if (temp_buffer 0x130) VOL++; -else if ( !(0x1AF temp_buffer temp_buffer 0x1B7) - !(0x1B9 temp_buffer temp_buffer 0x1C4)) res++; +if (temp_buffer == VOP_START_CODE) +VOP++; +else if (temp_buffer == VISUAL_OBJECT_START_CODE) +VISO++; +else if (temp_buffer 0x120) +VO++; +else if (temp_buffer 0x130) +VOL++; +else if (!(0x1AF temp_buffer temp_buffer 0x1B7) + !(0x1B9 temp_buffer temp_buffer 0x1C4)) +res++; } -if (VOP = VISO VOP = VOL VO = VOL VOL 0 res==0) +if (VOP = VISO VOP = VOL VO = VOL VOL 0 res == 0) return AVPROBE_SCORE_EXTENSION; return 0; } -FF_DEF_RAWVIDEO_DEMUXER(m4v, raw MPEG-4 video, mpeg4video_probe, m4v, AV_CODEC_ID_MPEG4) +FF_DEF_RAWVIDEO_DEMUXER(m4v, raw MPEG-4 video, mpeg4video_probe, m4v, +AV_CODEC_ID_MPEG4) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/img2dec: fix error code at EOF for pipes
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Thu Sep 25 15:12:27 2014 +0200| [1dbdcb4a8c76df70ab41e3dacbfe01d59ed4091e] | committer: Michael Niedermayer avformat/img2dec: fix error code at EOF for pipes Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1dbdcb4a8c76df70ab41e3dacbfe01d59ed4091e --- libavformat/img2dec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index a21429f..ad77812 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -422,7 +422,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt) } else { f[0] = s1-pb; if (avio_feof(f[0])) -return AVERROR(EIO); +return AVERROR_EOF; if (s-frame_size 0) { size[0] = s-frame_size; } else if (!s1-streams[0]-parser) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/img2dec: pass error code and signal EOF
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Thu Sep 25 16:17:08 2014 +0200| [2497914a1846c1dbcfb853ea834da0038f0e22f5] | committer: Michael Niedermayer avformat/img2dec: pass error code and signal EOF Found-by: Daemon404 Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2497914a1846c1dbcfb853ea834da0038f0e22f5 --- libavformat/img2dec.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index ad77812..bb94126 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -463,7 +463,13 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt) if (ret[0] = 0 || ret[1] 0 || ret[2] 0) { av_free_packet(pkt); -return AVERROR(EIO); /* signal EOF */ +if (ret[0] 0) { +return ret[0]; +} else if (ret[1] 0) { +return ret[1]; +} else if (ret[2] 0) +return ret[2]; +return AVERROR_EOF; } else { s-img_count++; s-img_number++; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
Re: [FFmpeg-cvslog] avformat/img2dec: reduce bmppipe probe score
Michael Niedermayer git at videolan.org writes: avformat/img2dec: reduce bmppipe probe score bmp pipe needs the bmp parser which is not bug free and should thus not be favored over the bmp image2 demuxer Do you have a sample for which the bmp parser fails? Carl Eugen ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/img2dec: enable generic seeking for image pipes
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Thu Sep 25 17:07:04 2014 +0200| [ce6e46be72292a748f37af50bfd5001dc5daa0e7] | committer: Michael Niedermayer avformat/img2dec: enable generic seeking for image pipes Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce6e46be72292a748f37af50bfd5001dc5daa0e7 --- libavformat/img2dec.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index c88db69..70bef9d 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -703,6 +703,7 @@ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\ .read_header= ff_img_read_header,\ .read_packet= ff_img_read_packet,\ .priv_class = imgname ## _class,\ +.flags = AVFMT_GENERIC_INDEX, \ .raw_codec_id = codecid,\ }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavu/ffmpeg_opt: Check return value of avcodec_find_encoder().
ffmpeg | branch: master | Thilo Borgmann thilo.borgm...@mail.de | Thu Sep 25 16:10:58 2014 +0200| [e113692c899f6d0b9e9f4307865d3c0a030fa20c] | committer: Michael Niedermayer lavu/ffmpeg_opt: Check return value of avcodec_find_encoder(). Prevents a segfault if a stream featuring a known but unavailable codec (like external lib codec) should be opened. Bug found by: Jonas Geistert j.geist...@yahoo.de Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e113692c899f6d0b9e9f4307865d3c0a030fa20c --- ffmpeg_opt.c |4 1 file changed, 4 insertions(+) diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 05ab652..4fb6fa3 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -1623,6 +1623,10 @@ static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const ch AVCodecContext *avctx; codec = avcodec_find_encoder(ic-streams[i]-codec-codec_id); +if (!codec) { +av_log(s, AV_LOG_ERROR, no encoder found for codec id %i\n, ic-streams[i]-codec-codec_id); +return AVERROR(EINVAL); +} ost = new_output_stream(o, s, codec-type, -1); st= ost-st; avctx = st-codec; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
Re: [FFmpeg-cvslog] avformat/img2dec: reduce bmppipe probe score
On Thu, Sep 25, 2014 at 03:43:12PM +, Carl Eugen Hoyos wrote: Michael Niedermayer git at videolan.org writes: avformat/img2dec: reduce bmppipe probe score bmp pipe needs the bmp parser which is not bug free and should thus not be favored over the bmp image2 demuxer Do you have a sample for which the bmp parser fails? probably but i dont remember, maybe it failed fate itself with one of the following commits without this [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell signature.asc Description: Digital signature ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] x86/cavsdsp: fix buffer alignment in cavs_idct8_add_mmx()
ffmpeg | branch: master | James Almer jamr...@gmail.com | Thu Sep 25 15:04:50 2014 -0300| [4b892e469bc9a1ccc10789b4b838bb7b1968cf6d] | committer: James Almer x86/cavsdsp: fix buffer alignment in cavs_idct8_add_mmx() It may be used by ff_add_pixels_clamped_sse2(). Should fix fate-cavs failures on some systems. Reviewed-by: Michael Niedermayer michae...@gmx.at Signed-off-by: James Almer jamr...@gmail.com http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b892e469bc9a1ccc10789b4b838bb7b1968cf6d --- libavcodec/x86/cavsdsp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c index 681d16a..190f6ee 100644 --- a/libavcodec/x86/cavsdsp.c +++ b/libavcodec/x86/cavsdsp.c @@ -139,7 +139,7 @@ static inline void cavs_idct8_1d(int16_t *block, uint64_t bias) static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride) { int i; -DECLARE_ALIGNED(8, int16_t, b2)[64]; +DECLARE_ALIGNED(16, int16_t, b2)[64]; for(i=0; i2; i++){ DECLARE_ALIGNED(8, uint64_t, tmp); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/svq1enc: align buffer used by simd functions
ffmpeg | branch: master | James Almer jamr...@gmail.com | Thu Sep 25 15:17:13 2014 -0300| [a829870b2f4dedc9d4758d7a86f363919b7fad92] | committer: James Almer avcodec/svq1enc: align buffer used by simd functions Reviewed-by: Michael Niedermayer michae...@gmx.at Signed-off-by: James Almer jamr...@gmail.com http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a829870b2f4dedc9d4758d7a86f363919b7fad92 --- libavcodec/svq1enc.c |2 +- libavcodec/x86/svq1enc.asm |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 850630f..288da1f 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -96,7 +96,7 @@ static int encode_block(SVQ1EncContext *s, uint8_t *src, uint8_t *ref, int w= 2 (level + 2 1); int h= 2 (level + 1 1); int size = w * h; -int16_t block[7][256]; +DECLARE_ALIGNED(16, int16_t, block)[7][256]; const int8_t *codebook_sum, *codebook; const uint16_t(*mean_vlc)[2]; const uint8_t(*multistage_vlc)[2]; diff --git a/libavcodec/x86/svq1enc.asm b/libavcodec/x86/svq1enc.asm index 5fb3361..24ee70f 100644 --- a/libavcodec/x86/svq1enc.asm +++ b/libavcodec/x86/svq1enc.asm @@ -29,7 +29,7 @@ cglobal ssd_int8_vs_int16, 3, 3, 3, pix1, pix2, size .loop sub sizeq, 8 movq m1, [pix1q + sizeq] -movu m2, [pix2q + sizeq*2] +mova m2, [pix2q + sizeq*2] %if mmsize == 8 movq m3, [pix2q + sizeq*2 + mmsize] punpckhbw m4, m1 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
Re: [FFmpeg-cvslog] avformat/img2dec: reduce bmppipe probe score
Michael Niedermayer michaelni at gmx.at writes: avformat/img2dec: reduce bmppipe probe score bmp pipe needs the bmp parser which is not bug free and should thus not be favored over the bmp image2 demuxer Do you have a sample for which the bmp parser fails? probably but i dont remember Then I suggest to revert until we have a sample (I will open a ticket if you find one). Carl Eugen ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/x86/idctdsp.h: Fix make checkheaders.
ffmpeg | branch: master | Carl Eugen Hoyos ceho...@ag.or.at | Thu Sep 25 22:18:25 2014 +0200| [c0f9df30dd025acf7c9855cb2c742e185a2ec8db] | committer: Carl Eugen Hoyos lavc/x86/idctdsp.h: Fix make checkheaders. http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c0f9df30dd025acf7c9855cb2c742e185a2ec8db --- libavcodec/x86/idctdsp.h |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/x86/idctdsp.h b/libavcodec/x86/idctdsp.h index 6408df1..daa4e79 100644 --- a/libavcodec/x86/idctdsp.h +++ b/libavcodec/x86/idctdsp.h @@ -20,6 +20,7 @@ #define AVCODEC_X86_IDCTDSP_H #include stdint.h +#include stddef.h void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dxtory: Support dxtory-2.0.127.avi
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Thu Sep 25 23:42:03 2014 +0200| [a43bcaafe20d07593d046c9a8b21afef69049b33] | committer: Michael Niedermayer avcodec/dxtory: Support dxtory-2.0.127.avi Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a43bcaafe20d07593d046c9a8b21afef69049b33 --- libavcodec/dxtory.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c index 1a59ae7..7e2ff27 100644 --- a/libavcodec/dxtory.c +++ b/libavcodec/dxtory.c @@ -424,7 +424,7 @@ static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic, return AVERROR_INVALIDDATA; } -if (!nslices || avctx-height % nslices) { +if (!nslices) { avpriv_request_sample(avctx, %d slices for %dx%d, nslices, avctx-width, avctx-height); return AVERROR_PATCHWELCOME; @@ -445,9 +445,9 @@ static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic, V = pic-data[2]; cur_y = 0; -next_y = ref_slice_height; for (slice = 0; slice nslices; slice++) { slice_size = bytestream2_get_le32(gb); +next_y = ((slice + 1) * avctx-height) / nslices; slice_height = (next_y ~3) - (cur_y ~3); if (slice_size src_size - off) { av_log(avctx, AV_LOG_ERROR, @@ -475,7 +475,6 @@ static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic, V += pic-linesize[2] * (slice_height 2); off += slice_size; cur_y = next_y; -next_y += ref_slice_height; } return 0; @@ -528,7 +527,7 @@ static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic, return AVERROR_INVALIDDATA; } -if (!nslices || avctx-height % nslices) { +if (!nslices) { avpriv_request_sample(avctx, %d slices for %dx%d, nslices, avctx-width, avctx-height); return AVERROR_PATCHWELCOME; @@ -549,9 +548,9 @@ static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic, V = pic-data[2]; cur_y = 0; -next_y = ref_slice_height; for (slice = 0; slice nslices; slice++) { slice_size = bytestream2_get_le32(gb); +next_y = ((slice + 1) * avctx-height) / nslices; slice_height = (next_y ~1) - (cur_y ~1); if (slice_size src_size - off) { av_log(avctx, AV_LOG_ERROR, @@ -579,7 +578,6 @@ static int dxtory_decode_v2_420(AVCodecContext *avctx, AVFrame *pic, V += pic-linesize[2] * (slice_height 1); off += slice_size; cur_y = next_y; -next_y += ref_slice_height; } return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Show correct pix_fmt for vp9 videos != AV_PIX_FMT_YUV420P.
ffmpeg | branch: master | Carl Eugen Hoyos ceho...@ag.or.at | Thu Sep 25 22:33:31 2014 +0200| [8de7bdd756b6a14d92dc48c34d3190d6a806934a] | committer: Carl Eugen Hoyos Show correct pix_fmt for vp9 videos != AV_PIX_FMT_YUV420P. http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8de7bdd756b6a14d92dc48c34d3190d6a806934a --- libavcodec/libvpxdec.c |1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index 65d391f..7faef3a 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -56,7 +56,6 @@ static av_cold int vpx_init(AVCodecContext *avctx, return AVERROR(EINVAL); } -avctx-pix_fmt = AV_PIX_FMT_YUV420P; return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Autodetect jpg images.
ffmpeg | branch: master | Carl Eugen Hoyos ceho...@ag.or.at | Thu Sep 25 23:02:06 2014 +0200| [88c937fdc8a8c887ca482aa26a9d6862e72d0dd3] | committer: Carl Eugen Hoyos Autodetect jpg images. Based on 2d3842f5 by Michael Niedermayer. Fixes ticket #2541. http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88c937fdc8a8c887ca482aa26a9d6862e72d0dd3 --- libavformat/Makefile |1 + libavformat/allformats.c |1 + libavformat/img2dec.c| 52 ++ libavformat/version.h|2 +- 4 files changed, 55 insertions(+), 1 deletion(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index d3bf48f..9f81320 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -194,6 +194,7 @@ OBJS-$(CONFIG_IMAGE_BMP_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_DPX_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_EXR_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_J2K_PIPE_DEMUXER) += img2dec.o img2.o +OBJS-$(CONFIG_IMAGE_JPEG_PIPE_DEMUXER)+= img2dec.o img2.o OBJS-$(CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_PICTOR_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_PNG_PIPE_DEMUXER) += img2dec.o img2.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 8f70c4b..9a71f26 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -325,6 +325,7 @@ void av_register_all(void) REGISTER_DEMUXER (IMAGE_DPX_PIPE,image_dpx_pipe); REGISTER_DEMUXER (IMAGE_EXR_PIPE,image_exr_pipe); REGISTER_DEMUXER (IMAGE_J2K_PIPE,image_j2k_pipe); +REGISTER_DEMUXER (IMAGE_JPEG_PIPE, image_jpeg_pipe); REGISTER_DEMUXER (IMAGE_JPEGLS_PIPE, image_jpegls_pipe); REGISTER_DEMUXER (IMAGE_PICTOR_PIPE, image_pictor_pipe); REGISTER_DEMUXER (IMAGE_PNG_PIPE,image_png_pipe); diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index 70bef9d..16bd699 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -620,6 +620,57 @@ static int j2k_probe(AVProbeData *p) return 0; } +static int jpeg_probe(AVProbeData *p) +{ +const uint8_t *b = p-buf; +int i, state = 0xD8; + +if (AV_RB16(b) != 0xFFD8 || +AV_RB32(b) == 0xFFD8FFF7) +return 0; + +b += 2; +for (i = 0; i p-buf_size - 2; i++) { +int c; +if (b[i] != 0xFF) +continue; +c = b[i + 1]; +switch (c) { +case 0xD8: +return 0; +case 0xC0: +case 0xC1: +case 0xC2: +case 0xC3: +case 0xC5: +case 0xC6: +case 0xC7: +if (state != 0xD8) +return 0; +state = 0xC0; +break; +case 0xDA: +if (state != 0xC0) +return 0; +state = 0xDA; +break; +case 0xD9: +if (state != 0xDA) +return 0; +state = 0xD9; +break; +default: +if ( (c = 0x02 c = 0xBF) +|| c == 0xC8) +return 0; +} +} + +if (state == 0xD9) +return AVPROBE_SCORE_EXTENSION + 1; +return AVPROBE_SCORE_EXTENSION / 8; +} + static int jpegls_probe(AVProbeData *p) { const uint8_t *b = p-buf; @@ -711,6 +762,7 @@ IMAGEAUTO_DEMUXER(bmp, AV_CODEC_ID_BMP) IMAGEAUTO_DEMUXER(dpx, AV_CODEC_ID_DPX) IMAGEAUTO_DEMUXER(exr, AV_CODEC_ID_EXR) IMAGEAUTO_DEMUXER(j2k, AV_CODEC_ID_JPEG2000) +IMAGEAUTO_DEMUXER(jpeg,AV_CODEC_ID_MJPEG) IMAGEAUTO_DEMUXER(jpegls, AV_CODEC_ID_JPEGLS) IMAGEAUTO_DEMUXER(pictor, AV_CODEC_ID_PICTOR) IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG) diff --git a/libavformat/version.h b/libavformat/version.h index b1dde2c..cb2d029 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include libavutil/version.h #define LIBAVFORMAT_VERSION_MAJOR 56 -#define LIBAVFORMAT_VERSION_MINOR 5 +#define LIBAVFORMAT_VERSION_MINOR 6 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Support libopenjpeg 2.x via libopenmj2.
ffmpeg | branch: master | Carl Eugen Hoyos ceho...@ag.or.at | Thu Sep 25 22:35:39 2014 +0200| [475e3799cdcc90a38f9bbc4c6b9159a028b1ad44] | committer: Carl Eugen Hoyos Support libopenjpeg 2.x via libopenmj2. Based on a patch by Marius Cirsta. Fixes ticket #2016. http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=475e3799cdcc90a38f9bbc4c6b9159a028b1ad44 --- configure |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 53a1e38..28c735e 100755 --- a/configure +++ b/configure @@ -4837,7 +4837,8 @@ enabled libnut require libnut libnut.h nut_demuxer_init -lnut enabled libopencore_amrnb require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb enabled libopencore_amrwb require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb enabled libopencv require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader -enabled libopenjpeg{ check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC || +enabled libopenjpeg{ check_lib openjpeg.h opj_version -lopenmj2 -DOPJ_STATIC || + check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC || check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC || die ERROR: libopenjpeg not found; } enabled libopusrequire_pkg_config opus opus_multistream.h opus_multistream_decoder_create ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavd/avfoundation: Split adding a device and getting the device configuration into separate functions.
ffmpeg | branch: master | Thilo Borgmann thilo.borgm...@mail.de | Wed Sep 24 12:16:31 2014 +0200| [a69c70e148d99240a48969179c0ac1f45f29ce89] | committer: Michael Niedermayer lavd/avfoundation: Split adding a device and getting the device configuration into separate functions. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a69c70e148d99240a48969179c0ac1f45f29ce89 --- libavdevice/avfoundation.m | 194 1 file changed, 105 insertions(+), 89 deletions(-) diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m index 4ac50a0..895bd29 100644 --- a/libavdevice/avfoundation.m +++ b/libavdevice/avfoundation.m @@ -172,99 +172,23 @@ static void destroy_context(AVFContext* ctx) } } -static int avf_read_header(AVFormatContext *s) +static int add_video_device(AVFormatContext *s, AVCaptureDevice *video_device) { -NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; -AVFContext *ctx = (AVFContext*)s-priv_data; -ctx-first_pts = av_gettime(); - -pthread_mutex_init(ctx-frame_lock, NULL); -pthread_cond_init(ctx-frame_wait_cond, NULL); - -// List devices if requested -if (ctx-list_devices) { -av_log(ctx, AV_LOG_INFO, AVFoundation video devices:\n); -NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; -for (AVCaptureDevice *device in devices) { -const char *name = [[device localizedName] UTF8String]; -int index = [devices indexOfObject:device]; -av_log(ctx, AV_LOG_INFO, [%d] %s\n, index, name); -} -goto fail; -} - -// Find capture device -AVCaptureDevice *video_device = nil; - -// check for device index given in filename -if (ctx-video_device_index == -1) { -sscanf(s-filename, %d, ctx-video_device_index); -} - -if (ctx-video_device_index = 0) { -NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; - -if (ctx-video_device_index = [devices count]) { -av_log(ctx, AV_LOG_ERROR, Invalid device index\n); -goto fail; -} - -video_device = [devices objectAtIndex:ctx-video_device_index]; -} else if (strncmp(s-filename, ,1) - strncmp(s-filename, default, 7)) { -NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; - -for (AVCaptureDevice *device in devices) { -if (!strncmp(s-filename, [[device localizedName] UTF8String], strlen(s-filename))) { -video_device = device; -break; -} -} - -if (!video_device) { -av_log(ctx, AV_LOG_ERROR, Video device not found\n); -goto fail; -} -} else { -video_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeMuxed]; -} - -// Video capture device not found, looking for AVMediaTypeVideo -if (!video_device) { -video_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; - -if (!video_device) { -av_log(s, AV_LOG_ERROR, No AV capture device found\n); -goto fail; -} -} - -NSString* dev_display_name = [video_device localizedName]; -av_log(s, AV_LOG_DEBUG, '%s' opened\n, [dev_display_name UTF8String]); - -// Initialize capture session -ctx-capture_session = [[AVCaptureSession alloc] init]; - -NSError *error = nil; +AVFContext *ctx = (AVFContext*)s-priv_data; +NSError *error = nil; AVCaptureDeviceInput* capture_dev_input = [[[AVCaptureDeviceInput alloc] initWithDevice:video_device error:error] autorelease]; if (!capture_dev_input) { av_log(s, AV_LOG_ERROR, Failed to create AV capture input device: %s\n, [[error localizedDescription] UTF8String]); -goto fail; -} - -if (!capture_dev_input) { -av_log(s, AV_LOG_ERROR, Failed to add AV capture input device to session: %s\n, - [[error localizedDescription] UTF8String]); -goto fail; +return 1; } if ([ctx-capture_session canAddInput:capture_dev_input]) { [ctx-capture_session addInput:capture_dev_input]; } else { av_log(s, AV_LOG_ERROR, can't add video input to capture session\n); -goto fail; +return 1; } // Attaching output @@ -272,7 +196,7 @@ static int avf_read_header(AVFormatContext *s) if (!ctx-video_output) { av_log(s, AV_LOG_ERROR, Failed to init AV video output\n); -goto fail; +return 1; } // select pixel format @@ -290,7 +214,7 @@ static int avf_read_header(AVFormatContext *s) if (pxl_fmt_spec.ff_id == AV_PIX_FMT_NONE) { av_log(s, AV_LOG_ERROR, Selected pixel format (%s) is not supported by AVFoundation.\n,
[FFmpeg-cvslog] lavd/avfoundation: Using the actual stream index instead of hardcoded value.
ffmpeg | branch: master | Thilo Borgmann thilo.borgm...@mail.de | Tue Sep 23 16:48:06 2014 +0200| [92827e186999fe0011c9cf440758d5532b90c31f] | committer: Michael Niedermayer lavd/avfoundation: Using the actual stream index instead of hardcoded value. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=92827e186999fe0011c9cf440758d5532b90c31f --- libavdevice/avfoundation.m |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m index 895bd29..207d5c9 100644 --- a/libavdevice/avfoundation.m +++ b/libavdevice/avfoundation.m @@ -89,6 +89,7 @@ typedef struct int list_devices; int video_device_index; +int video_stream_index; enum AVPixelFormat pixel_format; AVCaptureSession *capture_session; @@ -295,6 +296,8 @@ static int get_video_config(AVFormatContext *s) return 1; } +ctx-video_stream_index = stream-index; + avpriv_set_pts_info(stream, 64, 1, avf_time_base); CVImageBufferRef image_buffer = CMSampleBufferGetImageBuffer(ctx-current_frame); @@ -423,7 +426,7 @@ static int avf_read_packet(AVFormatContext *s, AVPacket *pkt) pkt-pts = pkt-dts = av_rescale_q(av_gettime() - ctx-first_pts, AV_TIME_BASE_Q, avf_time_base_q); -pkt-stream_index = 0; +pkt-stream_index = ctx-video_stream_index; pkt-flags|= AV_PKT_FLAG_KEY; CVPixelBufferLockBaseAddress(image_buffer, 0); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavd/avfoundation: Simplify debug message generation.
ffmpeg | branch: master | Thilo Borgmann thilo.borgm...@mail.de | Tue Sep 23 16:49:16 2014 +0200| [1ea7a3e04e42f686b53704193e60d0745681a959] | committer: Michael Niedermayer lavd/avfoundation: Simplify debug message generation. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ea7a3e04e42f686b53704193e60d0745681a959 --- libavdevice/avfoundation.m |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m index 207d5c9..5b1e694 100644 --- a/libavdevice/avfoundation.m +++ b/libavdevice/avfoundation.m @@ -384,8 +384,7 @@ static int avf_read_header(AVFormatContext *s) } } -NSString* dev_display_name = [video_device localizedName]; -av_log(s, AV_LOG_DEBUG, '%s' opened\n, [dev_display_name UTF8String]); +av_log(s, AV_LOG_DEBUG, '%s' opened\n, [[video_device localizedName] UTF8String]); // Initialize capture session ctx-capture_session = [[AVCaptureSession alloc] init]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog