On Thu, 23 Jun 2016, Vittorio Giovara wrote:
On Thu, Jun 23, 2016 at 7:06 AM, Martin Storsjö <[email protected]> wrote:
While it is less featureful (and slower) than the built-in H264
decoder, one could potentially want to use it to take advantage
of the cisco patent license offer.
---
I got a user explicitly requesting this feature, so apparently there
is (some) demand for it.
The decoder is very simple; it doesn't handle B-frames, so there's
no decoding delay, and the decoder doesn't allow decoding into
user-supplied buffers.
Can you add this blurb to a comment at the top of the file? it will
help when we hunt for non-DR1 codecs.
Just a comment saying "doesn't handle b-frames, doesn't do direct
rendering"? Sure
Could you also please mention the requirement for the bsf?
Do you mean like "the decoder expects input packets in annex b format,
thus using a bsf to conver to this format"?
---
configure | 2 +
libavcodec/Makefile | 1 +
libavcodec/allcodecs.c | 2 +-
libavcodec/libopenh264dec.c | 262 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 266 insertions(+), 1 deletion(-)
create mode 100644 libavcodec/libopenh264dec.c
+ state = (*s->decoder)->DecodeFrame2(s->decoder, s->pkt_filtered.data,
s->pkt_filtered.size, ptrs, &info);
+ s->pkt_filtered.size = 0;
+ if (state != dsErrorFree) {
+ av_log(avctx, AV_LOG_ERROR, "DecodeFrame2 failed\n");
+ return AVERROR_UNKNOWN;
+ }
+ if (info.iBufferStatus != 1) {
+ av_log(avctx, AV_LOG_DEBUG, "No frame produced\n");
+ continue;
+ }
+
+ avctx->width = info.UsrData.sSystemBuffer.iWidth;
+ avctx->height = info.UsrData.sSystemBuffer.iHeight;
ff_set_dimensions maybe?
Possibly
+
+AVCodec ff_libopenh264_decoder = {
+ .name = "libopenh264",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_H264,
+ .priv_data_size = sizeof(SVCContext),
+ .init = svc_decode_init,
+ .decode = svc_decode_frame,
+ .close = svc_decode_close,
+ .long_name = NULL_IF_CONFIG_SMALL("OpenH264"),
+ .capabilities = AV_CODEC_CAP_DELAY, // The decoder itself doesn't have
delay, but the BSF might
+ .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
could also set THREADSAFE and INITCLEANUP I believe
I guess so
// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel