[vlc-devel] [PATCH] WIP: add VideoToolbox based decoder
Ilkka Ollakka
ileoo at videolan.org
Tue Oct 14 06:52:17 CEST 2014
On Mon, Oct 13, 2014 at 10:32:30PM +0200, Felix Paul Kühne wrote:
> ---
> configure.ac | 11 +
> modules/codec/Makefile.am | 7 +
> modules/codec/videotoolbox.m | 657 +++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 675 insertions(+)
> create mode 100644 modules/codec/videotoolbox.m
Hi,
Do you use avio stuff anywhere else than creating that esds for mp4v
decoding? Just wondered that don't vlc's bs_write do the same? Also
doesn't fmt.p_extra contain that data for mp4v already?
> +static CFDataRef ESDSCreate(decoder_t *p_dec, uint8_t *p_buf, uint32_t i_buf_size)
> +{
> + AVIOContext *context;
> + int status;
> + uint8_t *rw_extradata;
> + int full_size = 3 + 5 +13 + 5 + i_buf_size + 3;
> + int config_size = 13 + 5 + i_buf_size;
> + int padding = 12;
> +
> + status = avio_open_dyn_buf(&context);
> + if (status != noErr)
> + msg_Err(p_dec, "opening dyn buf failed %i", status);
> +
> + avio_w8(context, 0); // Version
> + avio_wb24(context, 0); // Flags
> +
> + // elementary stream description tag
> + avio_w8(context, 0x03); // ES description tag
> + write_mp4_description_length(context, full_size);
> + avio_wb16(context, 0); // esid
> + avio_w8(context, 0); // stream priority (0-3)
> +
> + // decoder configuration description tag
> + avio_w8(context, 0x04);
> + write_mp4_description_length(context, config_size);
> + avio_w8(context, 32); // object type identification (32 = MPEG4)
> + avio_w8(context, 0x11); // stream type
> + avio_wb24(context, 0); // buffer size
> + avio_wb32(context, 0); // max bitrate
> + avio_wb32(context, 0); // avg bitrate
> +
> + // decoder specific description tag
> + avio_w8(context, 0x05); // dec specific info tag
> + write_mp4_description_length(context, i_buf_size);
> + avio_write(context, p_buf, i_buf_size);
> +
> + // sync layer configuration description tag
> + avio_w8(context, 0x06); // tag
> + avio_w8(context, 0x01); // length
> + avio_w8(context, 0x02); // no SL
> +
> + rw_extradata = malloc(full_size + padding);
> + avio_close_dyn_buf(context, &rw_extradata);
> +
> + CFDataRef data = CFDataCreate(kCFAllocatorDefault,
> + rw_extradata,
> + full_size + padding);
> +
> + return data;
> +}
--
Ilkka Ollakka
You will be surprised by a loud noise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20141014/2fff705a/attachment.sig>
More information about the vlc-devel
mailing list