[FFmpeg-cvslog] avfilter/av_biquads: scale a0 too

2018-01-06 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Jan  6 14:58:00 
2018 +0100| [50b3cd22dd70658b39abd0ced31b495d4d0a4b1b] | committer: Paul B Mahol

avfilter/av_biquads: scale a0 too

Fixes bug when using commands to alter coefficients.

Signed-off-by: Paul B Mahol 

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

 libavfilter/af_biquads.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 6e60e3b1b7..d5c3823e64 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -382,6 +382,7 @@ static int config_filter(AVFilterLink *outlink, int reset)
 s->b0 /= s->a0;
 s->b1 /= s->a0;
 s->b2 /= s->a0;
+s->a0 /= s->a0;
 
 s->cache = av_realloc_f(s->cache, sizeof(ChanCache), inlink->channels);
 if (!s->cache)

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


[FFmpeg-cvslog] avfilter: deprecate avfilter_link_get_channels()

2018-01-06 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Jan  5 17:49:09 
2018 -0300| [b2c42fc6dc3502a8b6cae441c54d898972a51cff] | committer: James Almer

avfilter: deprecate avfilter_link_get_channels()

Reviewed-by: Nicolas George 
Signed-off-by: James Almer 

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

 doc/APIchanges | 3 +++
 libavfilter/avfilter.c | 2 ++
 libavfilter/avfilter.h | 4 
 libavfilter/version.h  | 5 -
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 38c1be61c7..d66c842521 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
+2018-01-xx - xxx - lavfi 7.11.101 - avfilter.h
+  Deprecate avfilter_link_get_channels(). Use av_buffersink_get_channels().
+
 2017-xx-xx - xxx - lavr 4.0.0 - avresample.h
   Deprecate the entire library. Merged years ago to provide compatibility
   with Libav, it remained unmaintained by the FFmpeg project and duplicated
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index ff7df672fd..ea75467a75 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -183,10 +183,12 @@ void avfilter_link_free(AVFilterLink **link)
 av_freep(link);
 }
 
+#if FF_API_FILTER_GET_SET
 int avfilter_link_get_channels(AVFilterLink *link)
 {
 return link->channels;
 }
+#endif
 
 void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
 {
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 47546c15e5..62eed2168f 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -647,10 +647,14 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
  */
 void avfilter_link_free(AVFilterLink **link);
 
+#if FF_API_FILTER_GET_SET
 /**
  * Get the number of channels of a link.
+ * @deprecated Use av_buffersink_get_channels()
  */
+attribute_deprecated
 int avfilter_link_get_channels(AVFilterLink *link);
+#endif
 
 /**
  * Set the closed field of a link.
diff --git a/libavfilter/version.h b/libavfilter/version.h
index c07f4d30d9..0f11721822 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFILTER_VERSION_MAJOR   7
 #define LIBAVFILTER_VERSION_MINOR  11
-#define LIBAVFILTER_VERSION_MICRO 100
+#define LIBAVFILTER_VERSION_MICRO 101
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
@@ -55,5 +55,8 @@
 #ifndef FF_API_LAVR_OPTS
 #define FF_API_LAVR_OPTS(LIBAVFILTER_VERSION_MAJOR < 8)
 #endif
+#ifndef FF_API_FILTER_GET_SET
+#define FF_API_FILTER_GET_SET   (LIBAVFILTER_VERSION_MAJOR < 8)
+#endif
 
 #endif /* AVFILTER_VERSION_H */

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


[FFmpeg-cvslog] tools/uncoded_frame: use buffersink accessors.

2018-01-06 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Sat Jan  6 
14:14:04 2018 +0100| [34dfe36971aafd2b3bef04f1e78b2813e2f0b73f] | committer: 
Nicolas George

tools/uncoded_frame: use buffersink accessors.

No longer access buffersink's link structure directly.

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

 tools/uncoded_frame.c | 26 --
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/tools/uncoded_frame.c b/tools/uncoded_frame.c
index 3ca2ba4bbe..f346b21916 100644
--- a/tools/uncoded_frame.c
+++ b/tools/uncoded_frame.c
@@ -11,7 +11,6 @@ typedef struct {
 AVFormatContext *mux;
 AVStream *stream;
 AVFilterContext *sink;
-AVFilterLink *link;
 } Stream;
 
 static int create_sink(Stream *st, AVFilterGraph *graph,
@@ -36,7 +35,6 @@ static int create_sink(Stream *st, AVFilterGraph *graph,
 ret = avfilter_link(f, idx, st->sink, 0);
 if (ret < 0)
 return ret;
-st->link = st->sink->inputs[0];
 return 0;
 }
 
@@ -163,24 +161,24 @@ int main(int argc, char **argv)
 av_log(NULL, AV_LOG_ERROR, "Failed to create output stream\n");
 goto fail;
 }
-st->stream->codec->codec_type = st->link->type;
+st->stream->codec->codec_type = av_buffersink_get_type(st->sink);
 st->stream->time_base = st->stream->codec->time_base =
-st->link->time_base;
-switch (st->link->type) {
+av_buffersink_get_time_base(st->sink);
+switch (av_buffersink_get_type(st->sink)) {
 case AVMEDIA_TYPE_VIDEO:
 st->stream->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
 st->stream->avg_frame_rate =
 st->stream->  r_frame_rate = 
av_buffersink_get_frame_rate(st->sink);
-st->stream->codec->width   = st->link->w;
-st->stream->codec->height  = st->link->h;
-st->stream->codec->sample_aspect_ratio = 
st->link->sample_aspect_ratio;
-st->stream->codec->pix_fmt = st->link->format;
+st->stream->codec->width   = 
av_buffersink_get_w(st->sink);
+st->stream->codec->height  = 
av_buffersink_get_h(st->sink);
+st->stream->codec->sample_aspect_ratio = 
av_buffersink_get_sample_aspect_ratio(st->sink);
+st->stream->codec->pix_fmt = 
av_buffersink_get_format(st->sink);
 break;
 case AVMEDIA_TYPE_AUDIO:
-st->stream->codec->channel_layout = st->link->channel_layout;
-st->stream->codec->channels = avfilter_link_get_channels(st->link);
-st->stream->codec->sample_rate = st->link->sample_rate;
-st->stream->codec->sample_fmt = st->link->format;
+st->stream->codec->channel_layout = 
av_buffersink_get_channel_layout(st->sink);
+st->stream->codec->channels   = 
av_buffersink_get_channels(st->sink);
+st->stream->codec->sample_rate= 
av_buffersink_get_sample_rate(st->sink);
+st->stream->codec->sample_fmt = 
av_buffersink_get_format(st->sink);
 st->stream->codec->codec_id =
 av_get_pcm_codec(st->stream->codec->sample_fmt, -1);
 break;
@@ -240,7 +238,7 @@ int main(int argc, char **argv)
 }
 if (frame->pts != AV_NOPTS_VALUE)
 frame->pts = av_rescale_q(frame->pts,
-  st->link  ->time_base,
+  
av_buffersink_get_time_base(st->sink),
   st->stream->time_base);
 ret = av_interleaved_write_uncoded_frame(st->mux,
  st->stream->index,

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


[FFmpeg-cvslog] tools/uncoded_frame: remove use of AVStream.codec.

2018-01-06 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Sat Jan  6 
14:34:00 2018 +0100| [01735b4852c65081eaead3d9d405ef30fbb5a6ee] | committer: 
Nicolas George

tools/uncoded_frame: remove use of AVStream.codec.

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

 tools/uncoded_frame.c | 28 +---
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/tools/uncoded_frame.c b/tools/uncoded_frame.c
index f346b21916..606bdb746a 100644
--- a/tools/uncoded_frame.c
+++ b/tools/uncoded_frame.c
@@ -161,26 +161,24 @@ int main(int argc, char **argv)
 av_log(NULL, AV_LOG_ERROR, "Failed to create output stream\n");
 goto fail;
 }
-st->stream->codec->codec_type = av_buffersink_get_type(st->sink);
-st->stream->time_base = st->stream->codec->time_base =
-av_buffersink_get_time_base(st->sink);
+st->stream->codecpar->codec_type = av_buffersink_get_type(st->sink);
+st->stream->time_base = av_buffersink_get_time_base(st->sink);
 switch (av_buffersink_get_type(st->sink)) {
 case AVMEDIA_TYPE_VIDEO:
-st->stream->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
+st->stream->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
 st->stream->avg_frame_rate =
 st->stream->  r_frame_rate = 
av_buffersink_get_frame_rate(st->sink);
-st->stream->codec->width   = 
av_buffersink_get_w(st->sink);
-st->stream->codec->height  = 
av_buffersink_get_h(st->sink);
-st->stream->codec->sample_aspect_ratio = 
av_buffersink_get_sample_aspect_ratio(st->sink);
-st->stream->codec->pix_fmt = 
av_buffersink_get_format(st->sink);
+st->stream->codecpar->width   = 
av_buffersink_get_w(st->sink);
+st->stream->codecpar->height  = 
av_buffersink_get_h(st->sink);
+st->stream->codecpar->sample_aspect_ratio = 
av_buffersink_get_sample_aspect_ratio(st->sink);
+st->stream->codecpar->format  = 
av_buffersink_get_format(st->sink);
 break;
 case AVMEDIA_TYPE_AUDIO:
-st->stream->codec->channel_layout = 
av_buffersink_get_channel_layout(st->sink);
-st->stream->codec->channels   = 
av_buffersink_get_channels(st->sink);
-st->stream->codec->sample_rate= 
av_buffersink_get_sample_rate(st->sink);
-st->stream->codec->sample_fmt = 
av_buffersink_get_format(st->sink);
-st->stream->codec->codec_id =
-av_get_pcm_codec(st->stream->codec->sample_fmt, -1);
+st->stream->codecpar->channel_layout = 
av_buffersink_get_channel_layout(st->sink);
+st->stream->codecpar->channels   = 
av_buffersink_get_channels(st->sink);
+st->stream->codecpar->sample_rate= 
av_buffersink_get_sample_rate(st->sink);
+st->stream->codecpar->format = 
av_buffersink_get_format(st->sink);
+st->stream->codecpar->codec_id   = 
av_get_pcm_codec(st->stream->codecpar->format, -1);
 break;
 default:
 av_assert0(!"reached");
@@ -245,7 +243,7 @@ int main(int argc, char **argv)
  frame);
 frame = NULL;
 if (ret < 0) {
-av_log(st->stream->codec, AV_LOG_ERROR,
+av_log(st->mux, AV_LOG_ERROR,
"Error writing frame: %s\n", av_err2str(ret));
 goto fail;
 }

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


[FFmpeg-cvslog] avcodec/rkmpp : remove stream start retries before first frame.

2018-01-06 Thread LongChair
ffmpeg | branch: master | LongChair  | Tue Jan  2 
12:38:01 2018 +0100| [2ca65fc7b7edd51d5803a2c1e05a801a6023] | committer: wm4

avcodec/rkmpp : remove stream start retries before first frame.

those were needed because of some odd mpp behavior that seems to have
been fixed.

Makes the code cleaner.

Signed-off-by: wm4 

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

 libavcodec/rkmppdec.c | 24 +++-
 1 file changed, 3 insertions(+), 21 deletions(-)

diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c
index 946b827918..143d05bd51 100644
--- a/libavcodec/rkmppdec.c
+++ b/libavcodec/rkmppdec.c
@@ -47,7 +47,6 @@ typedef struct {
 MppApi *mpi;
 MppBufferGroup frame_group;
 
-char first_frame;
 char first_packet;
 char eos_reached;
 
@@ -329,28 +328,14 @@ static int rkmpp_retrieve_frame(AVCodecContext *avctx, 
AVFrame *frame)
 MppBuffer buffer = NULL;
 AVDRMFrameDescriptor *desc = NULL;
 AVDRMLayerDescriptor *layer = NULL;
-int retrycount = 0;
 int mode;
 MppFrameFormat mppformat;
 uint32_t drmformat;
 
-// on start of decoding, MPP can return -1, which is supposed to be 
expected
-// this is due to some internal MPP init which is not completed, that will
-// only happen in the first few frames queries, but should not be 
interpreted
-// as an error, Therefore we need to retry a couple times when we get -1
-// in order to let it time to complete it's init, then we sleep a bit 
between retries.
-retry_get_frame:
 ret = decoder->mpi->decode_get_frame(decoder->ctx, &mppframe);
-if (ret != MPP_OK && ret != MPP_ERR_TIMEOUT && !decoder->first_frame) {
-if (retrycount < 5) {
-av_log(avctx, AV_LOG_DEBUG, "Failed to get a frame, retrying (code 
= %d, retrycount = %d)\n", ret, retrycount);
-usleep(1);
-retrycount++;
-goto retry_get_frame;
-} else {
-av_log(avctx, AV_LOG_ERROR, "Failed to get a frame from MPP (code 
= %d)\n", ret);
-goto fail;
-}
+if (ret != MPP_OK && ret != MPP_ERR_TIMEOUT) {
+av_log(avctx, AV_LOG_ERROR, "Failed to get a frame from MPP (code = 
%d)\n", ret);
+goto fail;
 }
 
 if (mppframe) {
@@ -366,7 +351,6 @@ retry_get_frame:
 avctx->height = mpp_frame_get_height(mppframe);
 
 decoder->mpi->control(decoder->ctx, MPP_DEC_SET_INFO_CHANGE_READY, 
NULL);
-decoder->first_frame = 1;
 
 av_buffer_unref(&decoder->frames_ref);
 
@@ -480,7 +464,6 @@ retry_get_frame:
 goto fail;
 }
 
-decoder->first_frame = 0;
 return 0;
 } else {
 av_log(avctx, AV_LOG_ERROR, "Failed to retrieve the frame buffer, 
frame is dropped (code = %d)\n", ret);
@@ -560,7 +543,6 @@ static void rkmpp_flush(AVCodecContext *avctx)
 
 ret = decoder->mpi->reset(decoder->ctx);
 if (ret == MPP_OK) {
-decoder->first_frame = 1;
 decoder->first_packet = 1;
 } else
 av_log(avctx, AV_LOG_ERROR, "Failed to reset MPI (code = %d)\n", ret);

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


[FFmpeg-cvslog] avcodec/rkmpp : Fix broken build due to missing control operation

2018-01-06 Thread LongChair
ffmpeg | branch: master | LongChair  | Sat Jan  6 
09:36:58 2018 +0100| [c6f84106366c6f243a8b07dbffcc7880009aa904] | committer: wm4

avcodec/rkmpp : Fix broken build due to missing control operation

This patch is taking care of https://trac.ffmpeg.org/ticket/6834.
It seems that one of the control operations that was available to get
the free decoders input slots was removed.

There is another control operation to retrieve the used slots. Given
that the input slot count is hardcoded to 4 in mpp at this point,
replacing the old control operation by the other one.

This was tested on Rockchip ROCK64.

Signed-off-by: wm4 

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

 configure |  6 ++
 libavcodec/rkmppdec.c | 10 ++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 86d81e3cc3..455f9dc3fe 100755
--- a/configure
+++ b/configure
@@ -5993,10 +5993,8 @@ enabled openssl   && { check_pkg_config openssl 
openssl openssl/ssl.h OP
check_lib openssl openssl/ssl.h 
SSL_library_init -lssl32 -leay32 ||
check_lib openssl openssl/ssl.h 
SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
-enabled rkmpp && { { require_pkg_config rkmpp rockchip_mpp 
rockchip/rk_mpi.h mpp_create ||
- die "ERROR : Rockchip MPP was not found."; } 
&&
-   { check_func_headers rockchip/rk_mpi_cmd.h 
"MPP_DEC_GET_FREE_PACKET_SLOT_COUNT" ||
- die "ERROR: Rockchip MPP is outdated, please 
get a more recent one."; } &&
+enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp  
rockchip/rk_mpi.h mpp_create &&
+   require_pkg_config rockchip_mpp "rockchip_mpp 
>= 1.3.7" rockchip/rk_mpi.h mpp_create &&
{ enabled libdrm ||
  die "ERROR: rkmpp requires --enable-libdrm"; }
  }
diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c
index c57a6ded38..946b827918 100644
--- a/libavcodec/rkmppdec.c
+++ b/libavcodec/rkmppdec.c
@@ -40,6 +40,7 @@
 
 #define RECEIVE_FRAME_TIMEOUT   100
 #define FRAMEGROUP_MAX_FRAMES   16
+#define INPUT_MAX_PACKETS   4
 
 typedef struct {
 MppCtx ctx;
@@ -515,16 +516,17 @@ static int rkmpp_receive_frame(AVCodecContext *avctx, 
AVFrame *frame)
 RKMPPDecoder *decoder = (RKMPPDecoder *)rk_context->decoder_ref->data;
 int ret = MPP_NOK;
 AVPacket pkt = {0};
-RK_S32 freeslots;
+RK_S32 usedslots, freeslots;
 
 if (!decoder->eos_reached) {
 // we get the available slots in decoder
-ret = decoder->mpi->control(decoder->ctx, 
MPP_DEC_GET_FREE_PACKET_SLOT_COUNT, &freeslots);
+ret = decoder->mpi->control(decoder->ctx, MPP_DEC_GET_STREAM_COUNT, 
&usedslots);
 if (ret != MPP_OK) {
-av_log(avctx, AV_LOG_ERROR, "Failed to get decoder free slots 
(code = %d).\n", ret);
+av_log(avctx, AV_LOG_ERROR, "Failed to get decoder used slots 
(code = %d).\n", ret);
 return ret;
 }
 
+freeslots = INPUT_MAX_PACKETS - usedslots;
 if (freeslots > 0) {
 ret = ff_decode_get_packet(avctx, &pkt);
 if (ret < 0 && ret != AVERROR_EOF) {
@@ -541,7 +543,7 @@ static int rkmpp_receive_frame(AVCodecContext *avctx, 
AVFrame *frame)
 }
 
 // make sure we keep decoder full
-if (freeslots > 1 && decoder->first_frame)
+if (freeslots > 1)
 return AVERROR(EAGAIN);
 }
 

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


[FFmpeg-cvslog] libavformat: remove the ff_rtp_get_local_rtcp_port function

2018-01-06 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Sat Oct 
21 19:45:09 2017 +0100| [d41de90d440ae389262e13fb6c4dc3fdf7261b57] | committer: 
Rostislav Pehlivanov

libavformat: remove the ff_rtp_get_local_rtcp_port function

Only used by ffserver

Signed-off-by: Rostislav Pehlivanov 

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

 libavformat/libavformat.v | 1 -
 libavformat/rtpproto.c| 6 --
 libavformat/rtpproto.h| 1 -
 3 files changed, 8 deletions(-)

diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v
index e838f2918a..42b3e0c8e2 100644
--- a/libavformat/libavformat.v
+++ b/libavformat/libavformat.v
@@ -5,7 +5,6 @@ LIBAVFORMAT_MAJOR {
 ff_socket_nonblock;
 ff_rtsp_parse_line;
 ff_rtp_get_local_rtp_port;
-ff_rtp_get_local_rtcp_port;
 ffio_open_dyn_packet_buf;
 ffio_set_buf_size;
 ffurl_close;
diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c
index 0706cae25f..c01d9cea18 100644
--- a/libavformat/rtpproto.c
+++ b/libavformat/rtpproto.c
@@ -636,12 +636,6 @@ int ff_rtp_get_local_rtp_port(URLContext *h)
  * @return the local port number
  */
 
-int ff_rtp_get_local_rtcp_port(URLContext *h)
-{
-RTPContext *s = h->priv_data;
-return ff_udp_get_local_port(s->rtcp_hd);
-}
-
 static int rtp_get_file_handle(URLContext *h)
 {
 RTPContext *s = h->priv_data;
diff --git a/libavformat/rtpproto.h b/libavformat/rtpproto.h
index 5b243fb248..131aac5f3c 100644
--- a/libavformat/rtpproto.h
+++ b/libavformat/rtpproto.h
@@ -26,6 +26,5 @@
 int ff_rtp_set_remote_url(URLContext *h, const char *uri);
 
 int ff_rtp_get_local_rtp_port(URLContext *h);
-int ff_rtp_get_local_rtcp_port(URLContext *h);
 
 #endif /* AVFORMAT_RTPPROTO_H */

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


[FFmpeg-cvslog] libavformat/mpjpeg: use "ffmpeg" instead of "ffserver" as boundary tag

2018-01-06 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Sat Oct 
21 19:52:04 2017 +0100| [7c6125cbcc6e805711feff9cbf35329adcb6e313] | committer: 
Rostislav Pehlivanov

libavformat/mpjpeg: use "ffmpeg" instead of "ffserver" as boundary tag

Signed-off-by: Rostislav Pehlivanov 

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

 libavformat/mpjpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mpjpeg.c b/libavformat/mpjpeg.c
index 3904ccb2b4..80f83c5871 100644
--- a/libavformat/mpjpeg.c
+++ b/libavformat/mpjpeg.c
@@ -23,7 +23,7 @@
 
 /* Multipart JPEG */
 
-#define BOUNDARY_TAG "ffserver"
+#define BOUNDARY_TAG "ffmpeg"
 
 typedef struct MPJPEGContext {
 AVClass *class;

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


[FFmpeg-cvslog] libavformat: remove the ffmenc and ffmdec muxer and demuxers

2018-01-06 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Sat Oct 
21 19:38:59 2017 +0100| [c17f4761443b471f47fa8f0a5bcff078cdff9479] | committer: 
Rostislav Pehlivanov

libavformat: remove the ffmenc and ffmdec muxer and demuxers

Used only by ffserver.

Signed-off-by: Rostislav Pehlivanov 

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

 Changelog|   1 +
 libavformat/Makefile |   2 -
 libavformat/allformats.c |   1 -
 libavformat/ffm.h|  62 
 libavformat/ffmdec.c | 878 ---
 libavformat/ffmenc.c | 362 ---
 6 files changed, 1 insertion(+), 1305 deletions(-)

diff --git a/Changelog b/Changelog
index 028c20f482..c87977d6a9 100644
--- a/Changelog
+++ b/Changelog
@@ -36,6 +36,7 @@ version :
 - aiir audio filter
 - aiff: add support for CD-ROM XA ADPCM
 - Removed the ffserver program
+- Removed the ffmenc and ffmdec muxer and demuxer
 
 
 version 3.4:
diff --git a/libavformat/Makefile b/libavformat/Makefile
index cb70eac920..de0de921c2 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -161,8 +161,6 @@ OBJS-$(CONFIG_EA_DEMUXER)+= electronicarts.o
 OBJS-$(CONFIG_EAC3_DEMUXER)  += ac3dec.o rawdec.o
 OBJS-$(CONFIG_EAC3_MUXER)+= rawenc.o
 OBJS-$(CONFIG_EPAF_DEMUXER)  += epafdec.o pcm.o
-OBJS-$(CONFIG_FFM_DEMUXER)   += ffmdec.o
-OBJS-$(CONFIG_FFM_MUXER) += ffmenc.o
 OBJS-$(CONFIG_FFMETADATA_DEMUXER)+= ffmetadec.o
 OBJS-$(CONFIG_FFMETADATA_MUXER)  += ffmetaenc.o
 OBJS-$(CONFIG_FIFO_MUXER)+= fifo.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 6a9b9883c9..ec8409630e 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -120,7 +120,6 @@ static void register_all(void)
 REGISTER_MUXDEMUX(EAC3, eac3);
 REGISTER_DEMUXER (EPAF, epaf);
 REGISTER_MUXER   (F4V,  f4v);
-REGISTER_MUXDEMUX(FFM,  ffm);
 REGISTER_MUXDEMUX(FFMETADATA,   ffmetadata);
 REGISTER_MUXER   (FIFO, fifo);
 REGISTER_MUXDEMUX(FILMSTRIP,filmstrip);
diff --git a/libavformat/ffm.h b/libavformat/ffm.h
deleted file mode 100644
index c445f472f7..00
--- a/libavformat/ffm.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * FFM (ffserver live feed) common header
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_FFM_H
-#define AVFORMAT_FFM_H
-
-#include 
-#include "avformat.h"
-#include "avio.h"
-
-/* The FFM file is made of blocks of fixed size */
-#define FFM_HEADER_SIZE 14
-#define FFM_PACKET_SIZE 4096
-#define PACKET_ID   0x666d
-
-/* each packet contains frames (which can span several packets */
-#define FRAME_HEADER_SIZE16
-#define FLAG_KEY_FRAME   0x01
-#define FLAG_DTS 0x02
-
-enum {
-READ_HEADER,
-READ_DATA,
-};
-
-typedef struct FFMContext {
-const AVClass *class;
-/* only reading mode */
-int64_t write_index, file_size;
-int read_state;
-uint8_t header[FRAME_HEADER_SIZE+4];
-
-/* read and write */
-int first_packet; /* true if first packet, needed to set the discontinuity 
tag */
-int packet_size;
-int frame_offset;
-int64_t dts;
-uint8_t *packet_ptr, *packet_end;
-uint8_t packet[FFM_PACKET_SIZE];
-int64_t start_time;
-int server_attached;
-} FFMContext;
-
-#endif /* AVFORMAT_FFM_H */
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
deleted file mode 100644
index de6ac27252..00
--- a/libavformat/ffmdec.c
+++ /dev/null
@@ -1,878 +0,0 @@
-/*
- * FFM (ffserver live feed) demuxer
- * Copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS F

[FFmpeg-cvslog] libavformat: unexpose the ff_inet_aton function

2018-01-06 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Sat Oct 
21 19:40:50 2017 +0100| [9396ed0f291509e62235e12cd064d5b13b2473c2] | committer: 
Rostislav Pehlivanov

libavformat: unexpose the ff_inet_aton function

Used only by ffserver.

Signed-off-by: Rostislav Pehlivanov 

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

 libavformat/libavformat.v | 1 -
 libavformat/network.h | 2 --
 libavformat/os_support.c  | 6 +++---
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v
index 291a38f8e7..e838f2918a 100644
--- a/libavformat/libavformat.v
+++ b/libavformat/libavformat.v
@@ -2,7 +2,6 @@ LIBAVFORMAT_MAJOR {
 global:
 av*;
 #FIXME those are for ffserver
-ff_inet_aton;
 ff_socket_nonblock;
 ff_rtsp_parse_line;
 ff_rtp_get_local_rtp_port;
diff --git a/libavformat/network.h b/libavformat/network.h
index a663115541..3c0f873279 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -105,8 +105,6 @@ int ff_network_wait_fd_timeout(int fd, int write, int64_t 
timeout, AVIOInterrupt
  */
 int ff_network_sleep_interruptible(int64_t timeout, AVIOInterruptCB *int_cb);
 
-int ff_inet_aton (const char * str, struct in_addr * add);
-
 #if !HAVE_STRUCT_SOCKADDR_STORAGE
 struct sockaddr_storage {
 #if HAVE_STRUCT_SOCKADDR_SA_LEN
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 47445854c6..6bdfc04097 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -46,7 +46,7 @@
 #if !HAVE_INET_ATON
 #include 
 
-int ff_inet_aton(const char *str, struct in_addr *add)
+static int inet_aton(const char *str, struct in_addr *add)
 {
 unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
 
@@ -61,7 +61,7 @@ int ff_inet_aton(const char *str, struct in_addr *add)
 return 1;
 }
 #else
-int ff_inet_aton(const char *str, struct in_addr *add)
+static int inet_aton(const char *str, struct in_addr *add)
 {
 return inet_aton(str, add);
 }
@@ -82,7 +82,7 @@ int ff_getaddrinfo(const char *node, const char *service,
 sin->sin_family = AF_INET;
 
 if (node) {
-if (!ff_inet_aton(node, &sin->sin_addr)) {
+if (!inet_aton(node, &sin->sin_addr)) {
 if (hints && (hints->ai_flags & AI_NUMERICHOST)) {
 av_free(sin);
 return EAI_FAIL;

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


[FFmpeg-cvslog] libavformat: unexpose private ff_ functions needed by ffserver

2018-01-06 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Sat Jan  
6 18:37:06 2018 +| [8788e82c04fee409d6b56751a0925d4ee17d2f68] | committer: 
Rostislav Pehlivanov

libavformat: unexpose private ff_ functions needed by ffserver

Signed-off-by: Rostislav Pehlivanov 

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

 libavformat/libavformat.v | 9 -
 1 file changed, 9 deletions(-)

diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v
index 42b3e0c8e2..47d5ddcdb1 100644
--- a/libavformat/libavformat.v
+++ b/libavformat/libavformat.v
@@ -1,15 +1,6 @@
 LIBAVFORMAT_MAJOR {
 global:
 av*;
-#FIXME those are for ffserver
-ff_socket_nonblock;
-ff_rtsp_parse_line;
-ff_rtp_get_local_rtp_port;
-ffio_open_dyn_packet_buf;
-ffio_set_buf_size;
-ffurl_close;
-ffurl_open;
-ffurl_write;
 local:
 *;
 };

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


[FFmpeg-cvslog] libavformat/network: fix function duplication

2018-01-06 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Sat Jan  
6 18:59:46 2018 +| [c693af1951a0074a29ce39b69736ff0cf33b41d2] | committer: 
Rostislav Pehlivanov

libavformat/network: fix function duplication

Since the function used to be exposed for ffserver's sake, it was renamed
to the same name as a system's aton function which caused a collision.

Signed-off-by: Rostislav Pehlivanov 

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

 libavformat/os_support.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 6bdfc04097..099d7b501f 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -60,11 +60,6 @@ static int inet_aton(const char *str, struct in_addr *add)
 
 return 1;
 }
-#else
-static int inet_aton(const char *str, struct in_addr *add)
-{
-return inet_aton(str, add);
-}
 #endif /* !HAVE_INET_ATON */
 
 #if !HAVE_GETADDRINFO

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


[FFmpeg-cvslog] fate: remove missing references to ffm

2018-01-06 Thread James Almer
ffmpeg | branch: master | James Almer  | Sat Jan  6 16:14:52 
2018 -0300| [8bbd8c8d52dbcb15773717d3512f8fb68e860bf2] | committer: James Almer

fate: remove missing references to ffm

Missed in c17f4761443b471f47fa8f0a5bcff078cdff9479.

Signed-off-by: James Almer 

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

 tests/fate/avformat.mak | 1 -
 tests/fate/seek.mak | 2 --
 2 files changed, 3 deletions(-)

diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak
index c9ea99ad1b..a12f9ccc71 100644
--- a/tests/fate/avformat.mak
+++ b/tests/fate/avformat.mak
@@ -9,7 +9,6 @@ FATE_LAVF-$(call ENCDEC,  BMP,   IMAGE2)
 += bmp
 FATE_LAVF-$(call ENCDEC,  PCM_S16BE, CAF)+= caf
 FATE_LAVF-$(call ENCDEC,  DPX,   IMAGE2) += dpx
 FATE_LAVF-$(call ENCDEC2, DVVIDEO,PCM_S16LE, AVI)+= dv_fmt
-FATE_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,   FFM)+= ffm
 FATE_LAVF-$(call ENCDEC,  FITS,  FITS)   += fits
 FATE_LAVF-$(call ENCDEC,  RAWVIDEO,  FILMSTRIP)  += flm
 FATE_LAVF-$(call ENCDEC,  FLV,   FLV)+= flv_fmt
diff --git a/tests/fate/seek.mak b/tests/fate/seek.mak
index c863b2aaa4..751873baa4 100644
--- a/tests/fate/seek.mak
+++ b/tests/fate/seek.mak
@@ -168,7 +168,6 @@ FATE_SEEK_LAVF-$(call ENCDEC,  PCM_S16BE, AU)   
   += au
 FATE_SEEK_LAVF-$(call ENCDEC2, MPEG4,  MP2,   AVI) += avi
 FATE_SEEK_LAVF-$(call ENCDEC,  BMP,   IMAGE2)  += bmp
 FATE_SEEK_LAVF-$(call ENCDEC2, DVVIDEO,PCM_S16LE, AVI) += dv_fmt
-FATE_SEEK_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,   FFM) += ffm
 FATE_SEEK_LAVF-$(call ENCDEC,  FLV,   FLV) += flv_fmt
 FATE_SEEK_LAVF-$(call ENCDEC,  GIF,   IMAGE2)  += gif
 FATE_SEEK_LAVF-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, GXF) += gxf
@@ -210,7 +209,6 @@ fate-seek-lavf-au:   SRC = lavf/lavf.au
 fate-seek-lavf-avi:  SRC = lavf/lavf.avi
 fate-seek-lavf-bmp:  SRC = images/bmp/%02d.bmp
 fate-seek-lavf-dv_fmt:   SRC = lavf/lavf.dv
-fate-seek-lavf-ffm:  SRC = lavf/lavf.ffm
 fate-seek-lavf-flv_fmt:  SRC = lavf/lavf.flv
 fate-seek-lavf-gif:  SRC = lavf/lavf.gif
 fate-seek-lavf-gxf:  SRC = lavf/lavf.gxf

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


[FFmpeg-cvslog] lavc/mediacodecdec: remove mediacodec_process_data() indirection

2018-01-06 Thread Matthieu Bouron
ffmpeg | branch: master | Matthieu Bouron  | Wed Jan 
 3 13:10:58 2018 +0100| [d19174c673b8788de825a936d8d7c9340aefcd56] | committer: 
Matthieu Bouron

lavc/mediacodecdec: remove mediacodec_process_data() indirection

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

 libavcodec/mediacodecdec.c | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index 35a9e34861..6c5d3ddd79 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -416,15 +416,6 @@ done:
 return ret;
 }
 
-
-static int mediacodec_process_data(AVCodecContext *avctx, AVFrame *frame,
-   int *got_frame, AVPacket *pkt)
-{
-MediaCodecH264DecContext *s = avctx->priv_data;
-
-return ff_mediacodec_dec_decode(avctx, s->ctx, frame, got_frame, pkt);
-}
-
 static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
 {
 MediaCodecH264DecContext *s = avctx->priv_data;
@@ -505,7 +496,7 @@ static int mediacodec_receive_frame(AVCodecContext *avctx, 
AVFrame *frame)
 av_fifo_generic_read(s->fifo, &s->buffered_pkt, 
sizeof(s->buffered_pkt), NULL);
 }
 
-ret = mediacodec_process_data(avctx, frame, &got_frame, 
&s->buffered_pkt);
+ret = ff_mediacodec_dec_decode(avctx, s->ctx, frame, &got_frame, 
&s->buffered_pkt);
 if (ret < 0)
 return ret;
 

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


[FFmpeg-cvslog] lavc/mediacodecdec: switch to new decoding API

2018-01-06 Thread Aman Gupta
ffmpeg | branch: master | Aman Gupta  | Thu Dec 28 17:33:14 2017 
-0800| [9d9835017f67db7e37b6b5a42a247e17b05bf8fc] | committer: Matthieu Bouron

lavc/mediacodecdec: switch to new decoding API

Using the new API gives the decoder the ability to produce
N frames per input packet. This is particularly useful with
mpeg2 decoders on some android devices, which automatically
deinterlace video and produce one frame per field.

Signed-off-by: Aman Gupta 
Signed-off-by: Matthieu Bouron 

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

 libavcodec/mediacodecdec.c | 80 +++---
 1 file changed, 48 insertions(+), 32 deletions(-)

diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index b698ceaef9..35a9e34861 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -31,6 +31,7 @@
 #include "libavutil/pixfmt.h"
 
 #include "avcodec.h"
+#include "decode.h"
 #include "h264_parse.h"
 #include "hevc_parse.h"
 #include "hwaccel.h"
@@ -424,29 +425,13 @@ static int mediacodec_process_data(AVCodecContext *avctx, 
AVFrame *frame,
 return ff_mediacodec_dec_decode(avctx, s->ctx, frame, got_frame, pkt);
 }
 
-static int mediacodec_decode_frame(AVCodecContext *avctx, void *data,
-   int *got_frame, AVPacket *avpkt)
+static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
 {
 MediaCodecH264DecContext *s = avctx->priv_data;
-AVFrame *frame= data;
 int ret;
-
-/* buffer the input packet */
-if (avpkt->size) {
-AVPacket input_pkt = { 0 };
-
-if (av_fifo_space(s->fifo) < sizeof(input_pkt)) {
-ret = av_fifo_realloc2(s->fifo,
-   av_fifo_size(s->fifo) + sizeof(input_pkt));
-if (ret < 0)
-return ret;
-}
-
-ret = av_packet_ref(&input_pkt, avpkt);
-if (ret < 0)
-return ret;
-av_fifo_generic_write(s->fifo, &input_pkt, sizeof(input_pkt), NULL);
-}
+int got_frame = 0;
+int is_eof = 0;
+AVPacket pkt = { 0 };
 
 /*
  * MediaCodec.flush() discards both input and output buffers, thus we
@@ -470,26 +455,57 @@ static int mediacodec_decode_frame(AVCodecContext *avctx, 
void *data,
  */
 if (ff_mediacodec_dec_is_flushing(avctx, s->ctx)) {
 if (!ff_mediacodec_dec_flush(avctx, s->ctx)) {
-return avpkt->size;
+return AVERROR(EAGAIN);
 }
 }
 
+ret = ff_decode_get_packet(avctx, &pkt);
+if (ret == AVERROR_EOF)
+is_eof = 1;
+else if (ret == AVERROR(EAGAIN))
+; /* no input packet, but fallthrough to check for pending frames */
+else if (ret < 0)
+return ret;
+
+/* buffer the input packet */
+if (pkt.size) {
+if (av_fifo_space(s->fifo) < sizeof(pkt)) {
+ret = av_fifo_realloc2(s->fifo,
+   av_fifo_size(s->fifo) + sizeof(pkt));
+if (ret < 0) {
+av_packet_unref(&pkt);
+return ret;
+}
+}
+av_fifo_generic_write(s->fifo, &pkt, sizeof(pkt), NULL);
+}
+
 /* process buffered data */
-while (!*got_frame) {
+while (!got_frame) {
 /* prepare the input data */
 if (s->buffered_pkt.size <= 0) {
 av_packet_unref(&s->buffered_pkt);
 
 /* no more data */
 if (av_fifo_size(s->fifo) < sizeof(AVPacket)) {
-return avpkt->size ? avpkt->size :
-ff_mediacodec_dec_decode(avctx, s->ctx, frame, got_frame, 
avpkt);
+AVPacket null_pkt = { 0 };
+if (is_eof) {
+ret = ff_mediacodec_dec_decode(avctx, s->ctx, frame,
+   &got_frame, &null_pkt);
+if (ret < 0)
+return ret;
+else if (got_frame)
+return 0;
+else
+return AVERROR_EOF;
+}
+return AVERROR(EAGAIN);
 }
 
 av_fifo_generic_read(s->fifo, &s->buffered_pkt, 
sizeof(s->buffered_pkt), NULL);
 }
 
-ret = mediacodec_process_data(avctx, frame, got_frame, 
&s->buffered_pkt);
+ret = mediacodec_process_data(avctx, frame, &got_frame, 
&s->buffered_pkt);
 if (ret < 0)
 return ret;
 
@@ -497,7 +513,7 @@ static int mediacodec_decode_frame(AVCodecContext *avctx, 
void *data,
 s->buffered_pkt.data += ret;
 }
 
-return avpkt->size;
+return 0;
 }
 
 static void mediacodec_decode_flush(AVCodecContext *avctx)
@@ -537,7 +553,7 @@ AVCodec ff_h264_mediacodec_decoder = {
 .id = AV_CODEC_ID_H264,
 .priv_data_size = sizeof(MediaCodecH264DecContext),
 .init   = mediacodec_decode_init,
-.decode = m

[FFmpeg-cvslog] lavc/mediacodec_wrapper: allocate MediaCodec.BufferInfo once

2018-01-06 Thread Matthieu Bouron
ffmpeg | branch: master | Matthieu Bouron  | Wed Jan 
 3 13:54:34 2018 +0100| [e30b46b1aeea03fc5cbcecc03f7103cf204090f0] | committer: 
Matthieu Bouron

lavc/mediacodec_wrapper: allocate MediaCodec.BufferInfo once

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

 libavcodec/mediacodec_wrapper.c | 61 +++--
 1 file changed, 34 insertions(+), 27 deletions(-)

diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c
index d9f0e27a7d..dbc37bf463 100644
--- a/libavcodec/mediacodec_wrapper.c
+++ b/libavcodec/mediacodec_wrapper.c
@@ -274,6 +274,7 @@ struct FFAMediaCodec {
 struct JNIAMediaCodecFields jfields;
 
 jobject object;
+jobject buffer_info;
 
 jobject input_buffers;
 jobject output_buffers;
@@ -1143,6 +1144,7 @@ static inline FFAMediaCodec *codec_create(int method, 
const char *arg)
 FFAMediaCodec *codec = NULL;
 jstring jarg = NULL;
 jobject object = NULL;
+jobject buffer_info = NULL;
 jmethodID create_id = NULL;
 
 codec = av_mallocz(sizeof(FFAMediaCodec));
@@ -1195,6 +1197,16 @@ static inline FFAMediaCodec *codec_create(int method, 
const char *arg)
 codec->has_get_i_o_buffer = 1;
 }
 
+buffer_info = (*env)->NewObject(env, codec->jfields.mediainfo_class, 
codec->jfields.init_id);
+if (ff_jni_exception_check(env, 1, codec) < 0) {
+goto fail;
+}
+
+codec->buffer_info = (*env)->NewGlobalRef(env, buffer_info);
+if (!codec->buffer_info) {
+goto fail;
+}
+
 ret = 0;
 fail:
 if (jarg) {
@@ -1205,10 +1217,19 @@ fail:
 (*env)->DeleteLocalRef(env, object);
 }
 
+if (buffer_info) {
+(*env)->DeleteLocalRef(env, buffer_info);
+}
+
 if (ret < 0) {
 if (codec->object) {
 (*env)->DeleteGlobalRef(env, codec->object);
 }
+
+if (codec->buffer_info) {
+(*env)->DeleteGlobalRef(env, codec->buffer_info);
+}
+
 ff_jni_reset_jfields(env, &codec->jfields, jni_amediacodec_mapping, 1, 
codec);
 av_freep(&codec);
 }
@@ -1246,6 +1267,9 @@ int ff_AMediaCodec_delete(FFAMediaCodec* codec)
 (*env)->DeleteGlobalRef(env, codec->object);
 codec->object = NULL;
 
+(*env)->DeleteGlobalRef(env, codec->buffer_info);
+codec->buffer_info = NULL;
+
 ff_jni_reset_jfields(env, &codec->jfields, jni_amediacodec_mapping, 1, 
codec);
 
 av_freep(&codec);
@@ -1413,48 +1437,31 @@ ssize_t 
ff_AMediaCodec_dequeueOutputBuffer(FFAMediaCodec* codec, FFAMediaCodecBu
 int ret = 0;
 JNIEnv *env = NULL;
 
-jobject mediainfo = NULL;
-
 JNI_GET_ENV_OR_RETURN(env, codec, AVERROR_EXTERNAL);
 
-mediainfo = (*env)->NewObject(env, codec->jfields.mediainfo_class, 
codec->jfields.init_id);
+ret = (*env)->CallIntMethod(env, codec->object, 
codec->jfields.dequeue_output_buffer_id, codec->buffer_info, timeoutUs);
 if (ff_jni_exception_check(env, 1, codec) < 0) {
-ret = AVERROR_EXTERNAL;
-goto fail;
+return AVERROR_EXTERNAL;
 }
 
-ret = (*env)->CallIntMethod(env, codec->object, 
codec->jfields.dequeue_output_buffer_id, mediainfo, timeoutUs);
+info->flags = (*env)->GetIntField(env, codec->buffer_info, 
codec->jfields.flags_id);
 if (ff_jni_exception_check(env, 1, codec) < 0) {
-ret = AVERROR_EXTERNAL;
-goto fail;
+return AVERROR_EXTERNAL;
 }
 
-info->flags = (*env)->GetIntField(env, mediainfo, codec->jfields.flags_id);
+info->offset = (*env)->GetIntField(env, codec->buffer_info, 
codec->jfields.offset_id);
 if (ff_jni_exception_check(env, 1, codec) < 0) {
-ret = AVERROR_EXTERNAL;
-goto fail;
+return AVERROR_EXTERNAL;
 }
 
-info->offset = (*env)->GetIntField(env, mediainfo, 
codec->jfields.offset_id);
+info->presentationTimeUs = (*env)->GetLongField(env, codec->buffer_info, 
codec->jfields.presentation_time_us_id);
 if (ff_jni_exception_check(env, 1, codec) < 0) {
-ret = AVERROR_EXTERNAL;
-goto fail;
+return AVERROR_EXTERNAL;
 }
 
-info->presentationTimeUs = (*env)->GetLongField(env, mediainfo, 
codec->jfields.presentation_time_us_id);
+info->size = (*env)->GetIntField(env, codec->buffer_info, 
codec->jfields.size_id);
 if (ff_jni_exception_check(env, 1, codec) < 0) {
-ret = AVERROR_EXTERNAL;
-goto fail;
-}
-
-info->size = (*env)->GetIntField(env, mediainfo, codec->jfields.size_id);
-if (ff_jni_exception_check(env, 1, codec) < 0) {
-ret = AVERROR_EXTERNAL;
-goto fail;
-}
-fail:
-if (mediainfo) {
-(*env)->DeleteLocalRef(env, mediainfo);
+return AVERROR_EXTERNAL;
 }
 
 return ret;

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


[FFmpeg-cvslog] Changelog: add VideoToolbox HEVC support

2018-01-06 Thread Aman Gupta
ffmpeg | branch: master | Aman Gupta  | Sat Jan  6 15:30:07 2018 
-0800| [cc90ee0b7e47bcdb0405789aa6435db906d0774e] | committer: Aman Gupta

Changelog: add VideoToolbox HEVC support

Signed-off-by: Aman Gupta 

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

 Changelog | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Changelog b/Changelog
index c87977d6a9..61075b3392 100644
--- a/Changelog
+++ b/Changelog
@@ -37,6 +37,7 @@ version :
 - aiff: add support for CD-ROM XA ADPCM
 - Removed the ffserver program
 - Removed the ffmenc and ffmdec muxer and demuxer
+- VideoToolbox HEVC encoder and hwaccel
 
 
 version 3.4:

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


[FFmpeg-cvslog] configure: remove check for SA_RESTART

2018-01-06 Thread James Almer
ffmpeg | branch: master | James Almer  | Sat Jan  6 22:22:12 
2018 -0300| [9e68f472ec5d07538ea2f86c66f6ff534583028c] | committer: James Almer

configure: remove check for SA_RESTART

It's not used anymore.

Signed-off-by: James Almer 

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

 configure | 2 --
 1 file changed, 2 deletions(-)

diff --git a/configure b/configure
index c95b52e77d..d2a03da129 100755
--- a/configure
+++ b/configure
@@ -1899,7 +1899,6 @@ BUILTIN_LIST="
 MemoryBarrier
 mm_empty
 rdtsc
-sarestart
 sem_timedwait
 sync_val_compare_and_swap
 "
@@ -5612,7 +5611,6 @@ fi
 check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; 
atomic_cas_ptr(ptr, oldval, newval)"
 check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
 check_builtin MemoryBarrier windows.h "MemoryBarrier()"
-check_builtin sarestart signal.h "SA_RESTART"
 check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; 
__sync_val_compare_and_swap(ptr, oldval, newval)"
 check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
 check_builtin localtime_r time.h "time_t *time; struct tm *tm; 
localtime_r(time, tm)"

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


[FFmpeg-cvslog] fate: remove ffm reference files

2018-01-06 Thread James Almer
ffmpeg | branch: master | James Almer  | Sat Jan  6 22:21:35 
2018 -0300| [6ec91319204bd9836eb095a9da3150afebebf228] | committer: James Almer

fate: remove ffm reference files

Missed in c17f4761443b471f47fa8f0a5bcff078cdff9479 and
8bbd8c8d52dbcb15773717d3512f8fb68e860bf2

Signed-off-by: James Almer 

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

 tests/ref/lavf/ffm  |  3 ---
 tests/ref/seek/lavf-ffm | 53 -
 2 files changed, 56 deletions(-)

diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm
deleted file mode 100644
index d9fa8d52cb..00
--- a/tests/ref/lavf/ffm
+++ /dev/null
@@ -1,3 +0,0 @@
-ca2a450cd0d1e299514a345923b4c82a *./tests/data/lavf/lavf.ffm
-376832 ./tests/data/lavf/lavf.ffm
-./tests/data/lavf/lavf.ffm CRC=0x000e23ae
diff --git a/tests/ref/seek/lavf-ffm b/tests/ref/seek/lavf-ffm
deleted file mode 100644
index eceed1a2c2..00
--- a/tests/ref/seek/lavf-ffm
+++ /dev/null
@@ -1,53 +0,0 @@
-ret: 0 st: 0 flags:1 dts:-0.04 pts: 0.00 pos:   8192 size: 
24663
-ret: 0 st:-1 flags:0  ts:-1.00
-ret: 0 st: 0 flags:1 dts:-0.04 pts: 0.00 pos:   8192 size: 
24663
-ret: 0 st:-1 flags:1  ts: 1.894167
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st: 0 flags:0  ts: 0.788334
-ret: 0 st: 1 flags:1 dts: 0.825011 pts: 0.825011 pos: 327680 size:   
209
-ret: 0 st: 0 flags:1  ts:-0.317499
-ret: 0 st: 0 flags:1 dts:-0.04 pts: 0.00 pos:   8192 size: 
24663
-ret: 0 st: 1 flags:0  ts: 2.576668
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st: 1 flags:1  ts: 1.470835
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st:-1 flags:0  ts: 0.365002
-ret: 0 st: 1 flags:1 dts: 0.380930 pts: 0.380930 pos: 163840 size:   
209
-ret: 0 st:-1 flags:1  ts:-0.740831
-ret: 0 st: 0 flags:1 dts:-0.04 pts: 0.00 pos:   8192 size: 
24663
-ret: 0 st: 0 flags:0  ts: 2.153336
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st: 0 flags:1  ts: 1.047503
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st: 1 flags:0  ts:-0.058330
-ret: 0 st: 0 flags:1 dts:-0.04 pts: 0.00 pos:   8192 size: 
24663
-ret: 0 st: 1 flags:1  ts: 2.835837
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st:-1 flags:0  ts: 1.730004
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st:-1 flags:1  ts: 0.624171
-ret: 0 st: 1 flags:1 dts: 0.642154 pts: 0.642154 pos: 274432 size:   
209
-ret: 0 st: 0 flags:0  ts:-0.481662
-ret: 0 st: 0 flags:1 dts:-0.04 pts: 0.00 pos:   8192 size: 
24663
-ret: 0 st: 0 flags:1  ts: 2.412505
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st: 1 flags:0  ts: 1.306672
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st: 1 flags:1  ts: 0.200839
-ret: 0 st: 1 flags:1 dts: 0.224195 pts: 0.224195 pos: 114688 size:   
209
-ret: 0 st:-1 flags:0  ts:-0.904994
-ret: 0 st: 0 flags:1 dts:-0.04 pts: 0.00 pos:   8192 size: 
24663
-ret: 0 st:-1 flags:1  ts: 1.989173
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st: 0 flags:0  ts: 0.883340
-ret: 0 st: 0 flags:0 dts: 0.88 pts: 0.92 pos: 339968 size: 
12307
-ret: 0 st: 0 flags:1  ts:-0.222493
-ret: 0 st: 0 flags:1 dts:-0.04 pts: 0.00 pos:   8192 size: 
24663
-ret: 0 st: 1 flags:0  ts: 2.671674
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st: 1 flags:1  ts: 1.565841
-ret: 0 st: 1 flags:1 dts: 0.929501 pts: 0.929501 pos: 376832 size:   
209
-ret: 0 st:-1 flags:0  ts: 0.460008
-ret: 0 st: 1 flags:1 dts: 0.485420 pts: 0.485420 pos: 221184 size:   
209
-ret: 0 st:-1 flags:1  ts:-0.645825
-ret: 0 st: 0 flags:1 dts:-0.04 pts: 0.00 pos:   8192 size: 
24663

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


[FFmpeg-cvslog] configure: check SDL2 function with a header

2018-01-06 Thread KO Myung-Hun
ffmpeg | branch: master | KO Myung-Hun  | Thu Dec 28 
23:41:30 2017 +0900| [d03c39b46b21c893d6549a532289b7fb9935b3fc] | committer: 
James Almer

configure: check SDL2 function with a header

SDL2 uses SDLCALL to specify a calling convention. On OS/2, it's defined
to `_System' which is similar to `_cdecl' but does not prepend '_'.

After all, without a header, a function is used without `_System'. And
linker will try to `_func' but fail because the function is `func' not
`_func'.

Reviewed-by: Derek Buitenhuis 
Signed-off-by: James Almer 

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

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index d2a03da129..ab05b9c7f3 100755
--- a/configure
+++ b/configure
@@ -6009,14 +6009,14 @@ fi
 if enabled sdl2; then
 SDL2_CONFIG="${cross_prefix}sdl2-config"
 if test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h 
SDL_PollEvent; then
-check_func SDL_Init $sdl2_extralibs $sdl2_cflags ||
+check_func_headers SDL.h SDL_Init $sdl2_extralibs $sdl2_cflags ||
 disable sdl2
 elif "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
 sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
 sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
 check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | 
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
 check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | 
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
-check_func SDL_Init $sdl2_extralibs $sdl2_cflags &&
+check_func_headers SDL.h SDL_Init $sdl2_extralibs $sdl2_cflags &&
 enable sdl2
 fi
 if test $target_os = "mingw32"; then

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


[FFmpeg-cvslog] compat/os2threads: support static mutexes

2018-01-06 Thread KO Myung-Hun
ffmpeg | branch: master | KO Myung-Hun  | Thu Dec 28 22:03:56 
2017 +0900| [3c0a081a1e9fc4101252af0aeb6be020ecda43ed] | committer: James Almer

compat/os2threads: support static mutexes

Reviewed-by: wm4 
Signed-off-by: James Almer 

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

 compat/os2threads.h | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/compat/os2threads.h b/compat/os2threads.h
index 40a119ffe1..2177a033ec 100644
--- a/compat/os2threads.h
+++ b/compat/os2threads.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 KO Myung-Hun 
+ * Copyright (c) 2011-2017 KO Myung-Hun 
  *
  * This file is part of FFmpeg.
  *
@@ -46,9 +46,11 @@ typedef struct {
 
 typedef void pthread_attr_t;
 
-typedef HMTX pthread_mutex_t;
+typedef _fmutex pthread_mutex_t;
 typedef void pthread_mutexattr_t;
 
+#define PTHREAD_MUTEX_INITIALIZER _FMUTEX_INITIALIZER
+
 typedef struct {
 HEV event_sem;
 HEV ack_sem;
@@ -98,28 +100,28 @@ static av_always_inline int pthread_join(pthread_t thread, 
void **value_ptr)
 static av_always_inline int pthread_mutex_init(pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr)
 {
-DosCreateMutexSem(NULL, (PHMTX)mutex, 0, FALSE);
+_fmutex_create(mutex, 0);
 
 return 0;
 }
 
 static av_always_inline int pthread_mutex_destroy(pthread_mutex_t *mutex)
 {
-DosCloseMutexSem(*(PHMTX)mutex);
+_fmutex_close(mutex);
 
 return 0;
 }
 
 static av_always_inline int pthread_mutex_lock(pthread_mutex_t *mutex)
 {
-DosRequestMutexSem(*(PHMTX)mutex, SEM_INDEFINITE_WAIT);
+_fmutex_request(mutex, 0);
 
 return 0;
 }
 
 static av_always_inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
 {
-DosReleaseMutexSem(*(PHMTX)mutex);
+_fmutex_release(mutex);
 
 return 0;
 }

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


[FFmpeg-cvslog] avcodec/h264_slice: Do not attempt to render into frames already output

2018-01-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Jan  3 23:42:01 2018 +0100| [476665d4de989dba48ec1195215ccc8db54538f4] | 
committer: Michael Niedermayer

avcodec/h264_slice: Do not attempt to render into frames already output

Fixes: null pointer dereference
Fixes: 4698/clusterfuzz-testcase-minimized-5096956322906112

This testcase does not reproduce the issue before 
03b82b3ab9883cef017e513c7d0b3b986b3b3e7b

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 libavcodec/h264_slice.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index aad5484588..e6b7998834 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1571,6 +1571,12 @@ static int h264_field_start(H264Context *h, const 
H264SliceContext *sl,
  * one except for reference purposes. */
 h->first_field = 1;
 h->cur_pic_ptr = NULL;
+} else if (h->cur_pic_ptr->reference & DELAYED_PIC_REF) {
+/* This frame was already output, we cannot draw into it
+ * anymore.
+ */
+h->first_field = 1;
+h->cur_pic_ptr = NULL;
 } else {
 /* Second field in complementary pair */
 h->first_field = 0;

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