On Fri, Aug 11, 2017 at 12:36:56AM +0100, Mark Thompson wrote: > --- /dev/null > +++ b/libavcodec/cbs.c > @@ -0,0 +1,461 @@ > + > +int ff_cbs_init(CodedBitstreamContext *ctx, > + enum AVCodecID codec_id, void *log_ctx) > +{ > + ctx->log_ctx = log_ctx; > + > + ctx->codec = type;
nit: align > +void ff_cbs_fragment_uninit(CodedBitstreamContext *ctx, > + CodedBitstreamFragment *frag) > +{ > + av_freep(&frag->data); > + frag->data_size = 0; > + frag->data_bit_padding = 0; same > +int ff_cbs_read(CodedBitstreamContext *ctx, > + CodedBitstreamFragment *frag, > + const uint8_t *data, size_t size) > +{ > + int err; > + > + memset(frag, 0, sizeof(*frag)); > + > + // (We won't write to this during split.) > + frag->data = (uint8_t*)data; nit: space before * > +int ff_cbs_write_packet(CodedBitstreamContext *ctx, > + AVPacket *pkt, > + CodedBitstreamFragment *frag) Indentation is off. > +int ff_cbs_insert_unit_content(CodedBitstreamContext *ctx, > + CodedBitstreamFragment *frag, > + int position, uint32_t type, > + void *content) > +{ > + frag->units[position].type = type; > + frag->units[position].content = content; > + frag->units[position].content_external = 1; nit: align > --- /dev/null > +++ b/libavcodec/cbs.h > @@ -0,0 +1,274 @@ > + > +/** > + * Write the content of the fragment to its own internal buffer. > + * > + * Writes the content of all units and then assembles them into a new > + * data buffer. When modifying the content of decomposed units, this > + * can be used to regenerate the bitstream form of units or the whole > + * fragment so that it can be extracted for other use. > + */ > +int ff_cbs_write_fragment_data(CodedBitstreamContext *ctx, > + CodedBitstreamFragment *frag); > + It's odd to see a Brit like you use American double spaces after a period :) I recently dropped the habit of double spaces, the benefit appears dubious and since the use is not that widespread - even among USians it seems - so that I fit in better with single spaces. In case you're wondering or some outside reader is confused: this is not an actionable review comment, it's just random stylistic musing from my side. Diego _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel