[FFmpeg-cvslog] avformat/wavenc: replace literal numbers with enum constants

2017-10-05 Thread Tobias Rapp
ffmpeg | branch: master | Tobias Rapp  | Fri Sep 29 
16:28:47 2017 +0200| [c941e99b7f7ba16230aa72e644d519c33004dd47] | committer: 
Tobias Rapp

avformat/wavenc: replace literal numbers with enum constants

Signed-off-by: Tobias Rapp 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c941e99b7f7ba16230aa72e644d519c33004dd47
---

 libavformat/wavenc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index 7f3059e99a..adb20cb215 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -331,7 +331,7 @@ static int wav_write_header(AVFormatContext *s)
 ffio_fill(pb, 0, 28);
 }
 
-if (wav->write_peak != 2) {
+if (wav->write_peak != PEAK_ONLY) {
 /* format header */
 fmt = ff_start_tag(pb, "fmt ");
 if (ff_put_wav_header(s, pb, s->streams[0]->codecpar, 0) < 0) {
@@ -363,7 +363,7 @@ static int wav_write_header(AVFormatContext *s)
 wav->maxpts = wav->last_duration = 0;
 wav->minpts = INT64_MAX;
 
-if (wav->write_peak != 2) {
+if (wav->write_peak != PEAK_ONLY) {
 /* info header */
 ff_riff_write_info(s);
 
@@ -381,7 +381,7 @@ static int wav_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 AVIOContext *pb  = s->pb;
 WAVMuxContext*wav = s->priv_data;
 
-if (wav->write_peak != 2)
+if (wav->write_peak != PEAK_ONLY)
 avio_write(pb, pkt->data, pkt->size);
 
 if (wav->write_peak) {
@@ -426,7 +426,7 @@ static int wav_write_trailer(AVFormatContext *s)
 avio_flush(pb);
 
 if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
-if (wav->write_peak != 2 && avio_tell(pb) - wav->data < UINT32_MAX) {
+if (wav->write_peak != PEAK_ONLY && avio_tell(pb) - wav->data < 
UINT32_MAX) {
 ff_end_tag(pb, wav->data);
 avio_flush(pb);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavc/v4l2: Fix printf format for int64_t

2017-10-05 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Thu Oct  5 01:06:08 
2017 +0100| [e01a270762c1b79e10566e5e55a7eb4488b8a25b] | committer: Mark 
Thompson

lavc/v4l2: Fix printf format for int64_t

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e01a270762c1b79e10566e5e55a7eb4488b8a25b
---

 libavcodec/v4l2_m2m_enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index b0d5a3bd15..f71ce5fb74 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -180,7 +180,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s)
 
 av_log(avctx, AV_LOG_DEBUG,
 "Encoder Context: id (%d), profile (%d), frame rate(%d/%d), number 
b-frames (%d), "
-"gop size (%d), bit rate (%ld), qmin (%d), qmax (%d)\n",
+"gop size (%d), bit rate (%"PRId64"), qmin (%d), qmax (%d)\n",
 avctx->codec_id, avctx->profile, avctx->framerate.num, 
avctx->framerate.den,
 avctx->max_b_frames, avctx->gop_size, avctx->bit_rate, avctx->qmin, 
avctx->qmax);
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avfilter/vf_fps: clean-up filter options

2017-10-05 Thread Tobias Rapp
ffmpeg | branch: master | Tobias Rapp  | Thu Oct  5 
10:18:57 2017 +0200| [0a499d6a57409926011e1952fcf7ca39224663d6] | committer: 
Tobias Rapp

avfilter/vf_fps: clean-up filter options

Add missing AV_OPT_FLAG_FILTERING_PARAM flag to "start_time" option.
Fix indent of "round" named constants and clear unused field values.

Signed-off-by: Tobias Rapp 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0a499d6a57409926011e1952fcf7ca39224663d6
---

 libavfilter/vf_fps.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 1e5d07e31c..a5e51c3bbb 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -65,13 +65,13 @@ typedef struct FPSContext {
 #define F AV_OPT_FLAG_FILTERING_PARAM
 static const AVOption fps_options[] = {
 { "fps", "A string describing desired output framerate", 
OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, V|F },
-{ "start_time", "Assume the first PTS should be this value.", 
OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, V 
},
+{ "start_time", "Assume the first PTS should be this value.", 
OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, 
V|F },
 { "round", "set rounding method for timestamps", OFFSET(rounding), 
AV_OPT_TYPE_INT, { .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" },
-{ "zero", "round towards 0",  OFFSET(rounding), AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_ZERO }, 0, 5, V|F, "round" },
-{ "inf",  "round away from 0",OFFSET(rounding), AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_INF  }, 0, 5, V|F, "round" },
-{ "down", "round towards -infty", OFFSET(rounding), AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_DOWN }, 0, 5, V|F, "round" },
-{ "up",   "round towards +infty", OFFSET(rounding), AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_UP   }, 0, 5, V|F, "round" },
-{ "near", "round to nearest", OFFSET(rounding), AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" },
+{ "zero", "round towards 0", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_ZERO }, 0, 0, V|F, "round" },
+{ "inf",  "round away from 0",   0, AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_INF  }, 0, 0, V|F, "round" },
+{ "down", "round towards -infty",0, AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_DOWN }, 0, 0, V|F, "round" },
+{ "up",   "round towards +infty",0, AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_UP   }, 0, 0, V|F, "round" },
+{ "near", "round to nearest",0, AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_NEAR_INF }, 0, 0, V|F, "round" },
 { NULL }
 };
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] doc/filters: align order of fps filter options to implementation

2017-10-05 Thread Tobias Rapp
ffmpeg | branch: master | Tobias Rapp  | Thu Oct  5 
10:14:26 2017 +0200| [4f5fb7813423ae67d3a6897999cc97e02f75dee1] | committer: 
Tobias Rapp

doc/filters: align order of fps filter options to implementation

Align order of "start_time" option within fps filter documentation to actual
implementation. Also fix some documentation cosmetics.

Signed-off-by: Tobias Rapp 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f5fb7813423ae67d3a6897999cc97e02f75dee1
---

 doc/filters.texi | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 601701f591..624e5cd01b 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -8669,13 +8669,21 @@ It accepts the following parameters:
 @item fps
 The desired output frame rate. The default is @code{25}.
 
+@item start_time
+Assume the first PTS should be the given value, in seconds. This allows for
+padding/trimming at the start of stream. By default, no assumption is made
+about the first frame's expected PTS, so no padding or trimming is done.
+For example, this could be set to 0 to pad the beginning with duplicates of
+the first frame if a video stream starts after the audio stream or to trim any
+frames with a negative PTS.
+
 @item round
-Rounding method.
+Timestamp (PTS) rounding method.
 
 Possible values are:
 @table @option
 @item zero
-zero round towards 0
+round towards 0
 @item inf
 round away from 0
 @item down
@@ -8687,18 +8695,10 @@ round to nearest
 @end table
 The default is @code{near}.
 
-@item start_time
-Assume the first PTS should be the given value, in seconds. This allows for
-padding/trimming at the start of stream. By default, no assumption is made
-about the first frame's expected PTS, so no padding or trimming is done.
-For example, this could be set to 0 to pad the beginning with duplicates of
-the first frame if a video stream starts after the audio stream or to trim any
-frames with a negative PTS.
-
 @end table
 
 Alternatively, the options can be specified as a flat string:
-@var{fps}[:@var{round}].
+@var{fps}[:@var{start_time}[:@var{round}]].
 
 See also the @ref{setpts} filter.
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] build: add install targets for the examples

2017-10-05 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu Oct  5 00:47:41 
2017 -0300| [cafd9d66ed9e1bad4ae579a3935f7af57a567a51] | committer: James Almer

build: add install targets for the examples

Split it off from install-data.

Among other things, this prevents spamming triplicate log lines during install.

Reviewed-by: Clément Bœsch 
Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cafd9d66ed9e1bad4ae579a3935f7af57a567a51
---

 Makefile  |  6 ++
 doc/examples/Makefile | 14 +-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 3007da50f7..4a1253a052 100644
--- a/Makefile
+++ b/Makefile
@@ -120,11 +120,9 @@ install: install-libs install-headers
 
 install-libs: install-libs-yes
 
-install-data: $(DATA_FILES) $(EXAMPLES_FILES) $(EXAMPLE_MAKEFILE)
-   $(Q)mkdir -p "$(DATADIR)/examples"
+install-data: $(DATA_FILES)
+   $(Q)mkdir -p "$(DATADIR)"
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
-   $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
-   $(INSTALL) -m 644 $(EXAMPLE_MAKEFILE:%=%.example) 
"$(DATADIR)/examples/Makefile"
 
 uninstall: uninstall-libs uninstall-headers uninstall-data
 
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
index af000d9ddb..58afd71b85 100644
--- a/doc/examples/Makefile
+++ b/doc/examples/Makefile
@@ -26,8 +26,8 @@ ALL_EXAMPLES   := $(EXAMPLES) 
$(EXAMPLES-:%=doc/examples/%$(PROGSSUF)$(EXESUF))
 ALL_EXAMPLES_G := $(EXAMPLES_G) 
$(EXAMPLES-:%=doc/examples/%$(PROGSSUF)_g$(EXESUF))
 PROGS  += $(EXAMPLES)
 
-EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) 
$(SRC_PATH)/doc/examples/README
 EXAMPLE_MAKEFILE := $(SRC_PATH)/doc/examples/Makefile
+EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) 
$(SRC_PATH)/doc/examples/README $(EXAMPLE_MAKEFILE)
 
 $(foreach P,$(EXAMPLES),$(eval OBJS-$(P:%$(PROGSSUF)$(EXESUF)=%) = 
$(P:%$(PROGSSUF)$(EXESUF)=%).o))
 $(EXAMPLES_G): %$(PROGSSUF)_g$(EXESUF): %.o
@@ -39,6 +39,18 @@ OBJDIRS += doc/examples
 
 DOXY_INPUT += $(EXAMPLES:%$(PROGSSUF)$(EXESUF)=%.c)
 
+install: install-examples
+
+install-examples: $(EXAMPLES_FILES)
+   $(Q)mkdir -p "$(DATADIR)/examples"
+   $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
+   $(INSTALL) -m 644 $(EXAMPLE_MAKEFILE:%=%.example) 
"$(DATADIR)/examples/Makefile"
+
+uninstall: uninstall-examples
+
+uninstall-examples:
+   $(RM) -r "$(DATADIR)/examples"
+
 examplesclean:
$(RM) $(ALL_EXAMPLES) $(ALL_EXAMPLES_G)
$(RM) $(CLEANSUFFIXES:%=doc/examples/%)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat: fix id3 chapters

2017-10-05 Thread Lukas Stabe
ffmpeg | branch: master | Lukas Stabe  | Thu Oct  5 03:34:19 
2017 +0200| [1fd80106be3dca9fa0ea13fb364c8d221bd27c15] | committer: wm4

avformat: fix id3 chapters

These changes store id3 chapter data in ID3v2ExtraMeta and introduce
ff_id3v2_parse_chapters to parse them into the format context if needed.

Encoders using ff_id3v2_read, which previously parsed chapters into the
format context automatically, were adjusted to call
ff_id3v2_parse_chapters.

Signed-off-by: wm4 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1fd80106be3dca9fa0ea13fb364c8d221bd27c15
---

 libavformat/aiffdec.c  |   3 +-
 libavformat/asfdec_f.c |   4 +-
 libavformat/asfdec_o.c |   4 +-
 libavformat/dsfdec.c   |   4 +-
 libavformat/id3v2.c| 120 -
 libavformat/id3v2.h|  15 +--
 libavformat/iff.c  |   3 +-
 libavformat/omadec.c   |   5 +++
 libavformat/utils.c|   2 +
 9 files changed, 122 insertions(+), 38 deletions(-)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 2ef9386edb..99e05c78ec 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -258,7 +258,8 @@ static int aiff_read_header(AVFormatContext *s)
 position = avio_tell(pb);
 ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, size);
 if (id3v2_extra_meta)
-if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0) {
+if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0 ||
+(ret = ff_id3v2_parse_chapters(s, &id3v2_extra_meta)) < 0) 
{
 ff_id3v2_free_extra_meta(&id3v2_extra_meta);
 return ret;
 }
diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c
index cc648b9a2f..64a0b9d7f2 100644
--- a/libavformat/asfdec_f.c
+++ b/libavformat/asfdec_f.c
@@ -307,8 +307,10 @@ static void get_id3_tag(AVFormatContext *s, int len)
 ID3v2ExtraMeta *id3v2_extra_meta = NULL;
 
 ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, len);
-if (id3v2_extra_meta)
+if (id3v2_extra_meta) {
 ff_id3v2_parse_apic(s, &id3v2_extra_meta);
+ff_id3v2_parse_chapters(s, &id3v2_extra_meta);
+}
 ff_id3v2_free_extra_meta(&id3v2_extra_meta);
 }
 
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 818d6f3573..5122e33c78 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -460,8 +460,10 @@ static void get_id3_tag(AVFormatContext *s, int len)
 ID3v2ExtraMeta *id3v2_extra_meta = NULL;
 
 ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, len);
-if (id3v2_extra_meta)
+if (id3v2_extra_meta) {
 ff_id3v2_parse_apic(s, &id3v2_extra_meta);
+ff_id3v2_parse_chapters(s, &id3v2_extra_meta);
+}
 ff_id3v2_free_extra_meta(&id3v2_extra_meta);
 }
 
diff --git a/libavformat/dsfdec.c b/libavformat/dsfdec.c
index 49ca336427..41538fd83c 100644
--- a/libavformat/dsfdec.c
+++ b/libavformat/dsfdec.c
@@ -53,8 +53,10 @@ static void read_id3(AVFormatContext *s, uint64_t id3pos)
 return;
 
 ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, 0);
-if (id3v2_extra_meta)
+if (id3v2_extra_meta) {
 ff_id3v2_parse_apic(s, &id3v2_extra_meta);
+ff_id3v2_parse_chapters(s, &id3v2_extra_meta);
+}
 ff_id3v2_free_extra_meta(&id3v2_extra_meta);
 }
 
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index f15cefee47..6c216ba7a2 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -670,59 +670,68 @@ fail:
 avio_seek(pb, end, SEEK_SET);
 }
 
+static void free_chapter(void *obj)
+{
+ID3v2ExtraMetaCHAP *chap = obj;
+av_freep(&chap->element_id);
+av_dict_free(&chap->meta);
+av_freep(&chap);
+}
+
 static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, const 
char *ttag, ID3v2ExtraMeta **extra_meta, int isv34)
 {
-AVRational time_base = {1, 1000};
-uint32_t start, end;
-AVChapter *chapter;
-uint8_t *dst = NULL;
 int taglen;
 char tag[5];
+ID3v2ExtraMeta *new_extra = NULL;
+ID3v2ExtraMetaCHAP *chap  = NULL;
 
-if (!s) {
-/* We should probably just put the chapter data to extra_meta here
- * and do the AVFormatContext-needing part in a separate
- * ff_id3v2_parse_apic()-like function. */
-av_log(NULL, AV_LOG_DEBUG, "No AVFormatContext, skipped ID3 chapter 
data\n");
-return;
-}
+new_extra = av_mallocz(sizeof(*new_extra));
+chap  = av_mallocz(sizeof(*chap));
+
+if (!new_extra || !chap)
+goto fail;
+
+if (decode_str(s, pb, 0, &chap->element_id, &len) < 0)
+goto fail;
 
-if (decode_str(s, pb, 0, &dst, &len) < 0)
-return;
 if (len < 16)
-return;
+goto fail;
 
-start = avio_rb32(pb);
-end   = avio_rb32(pb);
+chap->start = avio_rb32(pb);
+chap->end   = avio_rb32(pb);
 avio_skip(pb, 8);
 
-chapter = avpriv_new_chapter(s, s->nb

Re: [FFmpeg-cvslog] Merge commit '79331df362fb05a0d04ca9489c87e5b80077a3f4'

2017-10-05 Thread Michael Niedermayer
On Wed, Oct 04, 2017 at 02:20:07AM +, James Almer wrote:
> ffmpeg | branch: master | James Almer  | Tue Oct  3 
> 23:08:06 2017 -0300| [1e7b6e47d2752a91bcd6d0c91ed2aaf118eaeee9] | committer: 
> James Almer
> 
> Merge commit '79331df362fb05a0d04ca9489c87e5b80077a3f4'
> 
> * commit '79331df362fb05a0d04ca9489c87e5b80077a3f4':
>   rtsp: Lazily set up the pollfd array once
> 
> Merged-by: James Almer 
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e7b6e47d2752a91bcd6d0c91ed2aaf118eaeee9
> ---
> 
>  libavformat/rtsp.c | 53 ++---
>  libavformat/rtsp.h |  1 +
>  2 files changed, 27 insertions(+), 27 deletions(-)

This breaks rtsp

example:
./ffmpeg -itsoffset 2 -re -i matrixbench_mpeg2.mpg -acodec libspeex -ar 16K -ac 
1 -vn -t 3 -f rtp rtp://127.0.0.1:19745 > speex.sdp flags & AVIO_FLAG_READ))
[Current thread is 1 (Thread 0x77f93800 (LWP 13134))]
(gdb) bt
Python Exception  No module named gdb.frames:
#0  0x00649110 in ffurl_read_complete (h=0x0, buf=0x7fff9f17 "", 
size=1) at libavformat/avio.c:414
#1  0x0077243a in ff_rtsp_read_reply (s=0x2171640, 
reply=0x7fffbd50, content_ptr=0x0, return_on_interleaved_data=0, 
method=0x0) at libavformat/rtsp.c:1165
#2  0x0077511d in udp_read_packet (s=0x2171640, 
prtsp_st=0x7fffd8d0, buf=0x21a2600 
"\200\341\002:\354\347^\301\220\362x\357\066\235m\232 
\001\r\376\265\270\251`\340\260\350", , 
buf_size=81920, wait_end=0) at libavformat/rtsp.c:1999
#3  0x0077547d in read_packet (s=0x2171640, rtsp_st=0x7fffd8d0, 
first_queue_st=0x0, wait_end=0) at libavformat/rtsp.c:2075
#4  0x007758ba in ff_rtsp_fetch_packet (s=0x2171640, 
pkt=0x7fffda90) at libavformat/rtsp.c:2161
#5  0x007ab592 in ff_read_packet (s=0x2171640, pkt=0x7fffda90) at 
libavformat/utils.c:816
#6  0x007ae65c in read_frame_internal (s=0x2171640, pkt=0x7fffde90) 
at libavformat/utils.c:1518
#7  0x007af674 in av_read_frame (s=0x2171640, pkt=0x7fffde90) at 
libavformat/utils.c:1722
#8  0x0043a7a1 in get_input_packet (f=0x2179140, pkt=0x7fffde90) at 
fftools/ffmpeg.c:4097
#9  0x0043abfd in process_input (file_index=0) at fftools/ffmpeg.c:4217
#10 0x0043c9ba in transcode_step () at fftools/ffmpeg.c:4553
#11 0x0043cb05 in transcode () at fftools/ffmpeg.c:4607
#12 0x0043d2e4 in main (argc=9, argv=0x7fffe3a8) at 
fftools/ffmpeg.c:4813
[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


signature.asc
Description: Digital signature
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


Re: [FFmpeg-cvslog] avfilter: add vmafmotion filter

2017-10-05 Thread Michael Niedermayer
On Sat, Sep 30, 2017 at 03:51:41PM +, Ashish Singh wrote:
> ffmpeg | branch: master | Ashish Singh  | Sat Sep 16 
> 02:35:58 2017 +0530| [148c8e88c43cfbabd6aee9f01ef30942cee9d359] | committer: 
> Ronald S. Bultje
> 
> avfilter: add vmafmotion filter
> 
> Signed-off-by: Ashish Singh 
> Signed-off-by: Ronald S. Bultje 
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=148c8e88c43cfbabd6aee9f01ef30942cee9d359
> ---
> 
>  Changelog   |   1 +
>  doc/filters.texi|  14 ++
>  libavfilter/Makefile|   1 +
>  libavfilter/allfilters.c|   1 +
>  libavfilter/vf_vmafmotion.c | 365 
> 
>  libavfilter/vmaf_motion.h   |  58 +++
>  6 files changed, 440 insertions(+)
[...]
> +static av_cold int init(AVFilterContext *ctx)
> +{
> +VMAFMotionContext *s = ctx->priv;
> +
> +if (s->stats_file_str) {
> +if (!strcmp(s->stats_file_str, "-")) {

> +s->stats_file = stdout;

Using stdout can interfere with the user application using the filter


> +} else {

> +s->stats_file = fopen(s->stats_file_str, "w");

Opening a filter parameter provided string for writing is a dangerous
way to output data. It allows one with access to the parameters to
overwrite any writable file

data should only be output in a safe way

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/mips: Cleanup unused functions

2017-10-05 Thread Kaustubh Raste
ffmpeg | branch: master | Kaustubh Raste  | Thu Oct  
5 13:33:06 2017 +0530| [51ebce7d7d614b15a9f27c67e419b4e2859335d7] | committer: 
Michael Niedermayer

avcodec/mips: Cleanup unused functions

Signed-off-by: Kaustubh Raste 
Reviewed-by: Manojkumar Bhosale 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51ebce7d7d614b15a9f27c67e419b4e2859335d7
---

 libavcodec/mips/h264qpel_msa.c | 746 -
 libavcodec/mips/hevc_mc_uniw_msa.c |  67 
 libavcodec/mips/hevcdsp_msa.c  |  50 ---
 3 files changed, 863 deletions(-)

diff --git a/libavcodec/mips/h264qpel_msa.c b/libavcodec/mips/h264qpel_msa.c
index 0b42bc4f72..afc0183312 100644
--- a/libavcodec/mips/h264qpel_msa.c
+++ b/libavcodec/mips/h264qpel_msa.c
@@ -159,300 +159,6 @@ static const uint8_t luma_mask_arr[16 * 8] = {
 out0_m; \
 } )
 
-static void avc_luma_hz_4w_msa(const uint8_t *src, int32_t src_stride,
-   uint8_t *dst, int32_t dst_stride,
-   int32_t height)
-{
-uint32_t loop_cnt;
-v16i8 src0, src1, src2, src3;
-v8i16 res0, res1;
-v16u8 out;
-v16i8 mask0, mask1, mask2;
-v16i8 vec0, vec1, vec2, vec3, vec4, vec5;
-v16i8 minus5b = __msa_ldi_b(-5);
-v16i8 plus20b = __msa_ldi_b(20);
-
-LD_SB3(&luma_mask_arr[48], 16, mask0, mask1, mask2);
-for (loop_cnt = (height >> 2); loop_cnt--;) {
-LD_SB4(src, src_stride, src0, src1, src2, src3);
-src += (4 * src_stride);
-
-XORI_B4_128_SB(src0, src1, src2, src3);
-VSHF_B2_SB(src0, src1, src2, src3, mask0, mask0, vec0, vec1);
-HADD_SB2_SH(vec0, vec1, res0, res1);
-VSHF_B2_SB(src0, src1, src2, src3, mask1, mask1, vec2, vec3);
-DPADD_SB2_SH(vec2, vec3, minus5b, minus5b, res0, res1);
-VSHF_B2_SB(src0, src1, src2, src3, mask2, mask2, vec4, vec5);
-DPADD_SB2_SH(vec4, vec5, plus20b, plus20b, res0, res1);
-SRARI_H2_SH(res0, res1, 5);
-SAT_SH2_SH(res0, res1, 7);
-out = PCKEV_XORI128_UB(res0, res1);
-ST4x4_UB(out, out, 0, 1, 2, 3, dst, dst_stride);
-dst += (4 * dst_stride);
-}
-}
-
-static void avc_luma_hz_8w_msa(const uint8_t *src, int32_t src_stride,
-   uint8_t *dst, int32_t dst_stride,
-   int32_t height)
-{
-uint32_t loop_cnt;
-v16i8 src0, src1, src2, src3;
-v8i16 res0, res1, res2, res3;
-v16i8 mask0, mask1, mask2;
-v16i8 vec0, vec1, vec2, vec3, vec4, vec5;
-v16i8 vec6, vec7, vec8, vec9, vec10, vec11;
-v16i8 minus5b = __msa_ldi_b(-5);
-v16i8 plus20b = __msa_ldi_b(20);
-v16u8 out0, out1;
-
-LD_SB3(&luma_mask_arr[0], 16, mask0, mask1, mask2);
-
-for (loop_cnt = (height >> 2); loop_cnt--;) {
-LD_SB4(src, src_stride, src0, src1, src2, src3);
-src += (4 * src_stride);
-
-XORI_B4_128_SB(src0, src1, src2, src3);
-VSHF_B2_SB(src0, src0, src1, src1, mask0, mask0, vec0, vec1);
-VSHF_B2_SB(src2, src2, src3, src3, mask0, mask0, vec2, vec3);
-HADD_SB4_SH(vec0, vec1, vec2, vec3, res0, res1, res2, res3);
-VSHF_B2_SB(src0, src0, src1, src1, mask1, mask1, vec4, vec5);
-VSHF_B2_SB(src2, src2, src3, src3, mask1, mask1, vec6, vec7);
-DPADD_SB4_SH(vec4, vec5, vec6, vec7, minus5b, minus5b, minus5b, 
minus5b,
- res0, res1, res2, res3);
-VSHF_B2_SB(src0, src0, src1, src1, mask2, mask2, vec8, vec9);
-VSHF_B2_SB(src2, src2, src3, src3, mask2, mask2, vec10, vec11);
-DPADD_SB4_SH(vec8, vec9, vec10, vec11, plus20b, plus20b, plus20b,
- plus20b, res0, res1, res2, res3);
-SRARI_H4_SH(res0, res1, res2, res3, 5);
-SAT_SH4_SH(res0, res1, res2, res3, 7);
-out0 = PCKEV_XORI128_UB(res0, res1);
-out1 = PCKEV_XORI128_UB(res2, res3);
-ST8x4_UB(out0, out1, dst, dst_stride);
-dst += (4 * dst_stride);
-}
-}
-
-static void avc_luma_hz_16w_msa(const uint8_t *src, int32_t src_stride,
-uint8_t *dst, int32_t dst_stride,
-int32_t height)
-{
-uint32_t loop_cnt;
-v16i8 src0, src1, src2, src3, src4, src5, src6, src7;
-v8i16 res0, res1, res2, res3, res4, res5, res6, res7;
-v16i8 mask0, mask1, mask2;
-v16i8 vec0, vec1, vec2, vec3, vec4, vec5;
-v16i8 vec6, vec7, vec8, vec9, vec10, vec11;
-v16i8 minus5b = __msa_ldi_b(-5);
-v16i8 plus20b = __msa_ldi_b(20);
-
-LD_SB3(&luma_mask_arr[0], 16, mask0, mask1, mask2);
-
-for (loop_cnt = (height >> 2); loop_cnt--;) {
-LD_SB2(src, 8, src0, src1);
-src += src_stride;
-LD_SB2(src, 8, src2, src3);
-src += src_stride;
-
-XORI_B4_128_SB(src0, src1, src2, src3);
-VSHF_B2_SB(src0, src0, src1, src1, mask0, mask0, vec0, vec3);
-VSHF_B2_SB(src2, src2, src3, 

[FFmpeg-cvslog] rtsp: Move message parsing to a separate function

2017-10-05 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Tue Mar 14 
17:44:45 2017 +0100| [1e27837265702b63db65122e97178a0ca4d25e05] | committer: 
James Almer

rtsp: Move message parsing to a separate function

Make easier to handle the polling function before we implement
full threading support.

(cherry picked from libav commit ca960161f087ca38267b88ce90592010c59584f1)
Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e27837265702b63db65122e97178a0ca4d25e05
---

 libavformat/rtsp.c | 57 ++
 1 file changed, 32 insertions(+), 25 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 375d0d9e14..b6da61b95e 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1918,12 +1918,39 @@ redirect:
 #endif /* CONFIG_RTSP_DEMUXER || CONFIG_RTSP_MUXER */
 
 #if CONFIG_RTPDEC
+static int parse_rtsp_message(AVFormatContext *s)
+{
+RTSPState *rt = s->priv_data;
+int ret;
+
+if (rt->rtsp_flags & RTSP_FLAG_LISTEN) {
+if (rt->state == RTSP_STATE_STREAMING) {
+if (!ff_rtsp_parse_streaming_commands(s))
+return AVERROR_EOF;
+else
+av_log(s, AV_LOG_WARNING,
+   "Unable to answer to TEARDOWN\n");
+} else
+return 0;
+} else {
+RTSPMessageHeader reply;
+ret = ff_rtsp_read_reply(s, &reply, NULL, 0, NULL);
+if (ret < 0)
+return ret;
+/* XXX: parse message */
+if (rt->state != RTSP_STATE_STREAMING)
+return 0;
+}
+
+return 0;
+}
+
 static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
uint8_t *buf, int buf_size, int64_t wait_end)
 {
 RTSPState *rt = s->priv_data;
 RTSPStream *rtsp_st;
-int n, i, ret, tcp_fd, timeout_cnt = 0;
+int n, i, ret, timeout_cnt = 0;
 struct pollfd *p = rt->p;
 int *fds = NULL, fdsnum, fdsidx;
 
@@ -1933,11 +1960,8 @@ static int udp_read_packet(AVFormatContext *s, 
RTSPStream **prtsp_st,
 return AVERROR(ENOMEM);
 
 if (rt->rtsp_hd) {
-tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
-p[rt->max_p].fd = tcp_fd;
+p[rt->max_p].fd = ffurl_get_file_handle(rt->rtsp_hd);
 p[rt->max_p++].events = POLLIN;
-} else {
-tcp_fd = -1;
 }
 for (i = 0; i < rt->nb_rtsp_streams; i++) {
 rtsp_st = rt->rtsp_streams[i];
@@ -1968,7 +1992,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream 
**prtsp_st,
 return AVERROR(EAGAIN);
 n = poll(p, rt->max_p, POLL_TIMEOUT_MS);
 if (n > 0) {
-int j = 1 - (tcp_fd == -1);
+int j = rt->rtsp_hd ? 1 : 0;
 timeout_cnt = 0;
 for (i = 0; i < rt->nb_rtsp_streams; i++) {
 rtsp_st = rt->rtsp_streams[i];
@@ -1984,25 +2008,8 @@ static int udp_read_packet(AVFormatContext *s, 
RTSPStream **prtsp_st,
 }
 }
 #if CONFIG_RTSP_DEMUXER
-if (tcp_fd != -1 && p[0].revents & POLLIN) {
-if (rt->rtsp_flags & RTSP_FLAG_LISTEN) {
-if (rt->state == RTSP_STATE_STREAMING) {
-if (!ff_rtsp_parse_streaming_commands(s))
-return AVERROR_EOF;
-else
-av_log(s, AV_LOG_WARNING,
-   "Unable to answer to TEARDOWN\n");
-} else
-return 0;
-} else {
-RTSPMessageHeader reply;
-ret = ff_rtsp_read_reply(s, &reply, NULL, 0, NULL);
-if (ret < 0)
-return ret;
-/* XXX: parse message */
-if (rt->state != RTSP_STATE_STREAMING)
-return 0;
-}
+if (rt->rtsp_hd && p[0].revents & POLLIN) {
+return parse_rtsp_message(s);
 }
 #endif
 } else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog