FFmpeg
Macros | Functions | Variables
cbs_jpeg.c File Reference
#include "cbs.h"
#include "cbs_internal.h"
#include "cbs_jpeg.h"
#include "cbs_jpeg_syntax_template.c"

Go to the source code of this file.

Macros

#define HEADER(name)
 
#define CHECK(call)
 
#define SUBSCRIPTS(subs, ...)   (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
 
#define u(width, name, range_min, range_max)   xu(width, name, range_min, range_max, 0)
 
#define us(width, name, sub, range_min, range_max)   xu(width, name, range_min, range_max, 1, sub)
 
#define READ
 
#define READWRITE   read
 
#define RWContext   GetBitContext
 
#define FUNC(name)   cbs_jpeg_read_ ## name
 
#define xu(width, name, range_min, range_max, subs, ...)
 
#define WRITE
 
#define READWRITE   write
 
#define RWContext   PutBitContext
 
#define FUNC(name)   cbs_jpeg_write_ ## name
 
#define xu(width, name, range_min, range_max, subs, ...)
 
#define SEGMENT(marker, type, func, free)
 
#define SEGMENT(marker, func)
 

Functions

static void cbs_jpeg_free_application_data (void *opaque, uint8_t *content)
 
static void cbs_jpeg_free_comment (void *opaque, uint8_t *content)
 
static void cbs_jpeg_free_scan (void *opaque, uint8_t *content)
 
static int cbs_jpeg_split_fragment (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
 
static int cbs_jpeg_read_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
 
static int cbs_jpeg_write_scan (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
 
static int cbs_jpeg_write_segment (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
 
static int cbs_jpeg_write_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
 
static int cbs_jpeg_assemble_fragment (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
 
static void cbs_jpeg_close (CodedBitstreamContext *ctx)
 

Variables

const CodedBitstreamType ff_cbs_type_jpeg
 

Macro Definition Documentation

#define HEADER (   name)
Value:
do { \
} while (0)
void ff_cbs_trace_header(CodedBitstreamContext *ctx, const char *name)
Definition: cbs.c:370
AVFormatContext * ctx
Definition: movenc.c:48
const char * name
Definition: opengl_enc.c:102

Definition at line 24 of file cbs_jpeg.c.

#define CHECK (   call)
Value:
do { \
err = (call); \
if (err < 0) \
return err; \
} while (0)
if(ret)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return

Definition at line 28 of file cbs_jpeg.c.

#define SUBSCRIPTS (   subs,
  ... 
)    (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)

Definition at line 34 of file cbs_jpeg.c.

#define u (   width,
  name,
  range_min,
  range_max 
)    xu(width, name, range_min, range_max, 0)

Definition at line 36 of file cbs_jpeg.c.

#define us (   width,
  name,
  sub,
  range_min,
  range_max 
)    xu(width, name, range_min, range_max, 1, sub)

Definition at line 38 of file cbs_jpeg.c.

#define READ

Definition at line 42 of file cbs_jpeg.c.

#define READWRITE   read

Definition at line 64 of file cbs_jpeg.c.

#define RWContext   GetBitContext

Definition at line 65 of file cbs_jpeg.c.

#define FUNC (   name)    cbs_jpeg_read_ ## name

Definition at line 66 of file cbs_jpeg.c.

#define xu (   width,
  name,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
uint32_t value; \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
current->name = value; \
} while (0)
#define CHECK(call)
Definition: cbs_jpeg.c:28
int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:429
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:108
#define SUBSCRIPTS(subs,...)
Definition: cbs_jpeg.c:34
#define width
AVFormatContext * ctx
Definition: movenc.c:48
const char * name
Definition: opengl_enc.c:102

Definition at line 68 of file cbs_jpeg.c.

#define WRITE

Definition at line 63 of file cbs_jpeg.c.

#define READWRITE   write

Definition at line 64 of file cbs_jpeg.c.

#define RWContext   PutBitContext

Definition at line 65 of file cbs_jpeg.c.

#define FUNC (   name)    cbs_jpeg_write_ ## name

Definition at line 66 of file cbs_jpeg.c.

#define xu (   width,
  name,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
uint32_t value = current->name; \
SUBSCRIPTS(subs, __VA_ARGS__), \
value, range_min, range_max)); \
} while (0)
#define CHECK(call)
Definition: cbs_jpeg.c:28
int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:472
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:108
#define SUBSCRIPTS(subs,...)
Definition: cbs_jpeg.c:34
#define width
AVFormatContext * ctx
Definition: movenc.c:48
const char * name
Definition: opengl_enc.c:102

Definition at line 68 of file cbs_jpeg.c.

#define SEGMENT (   marker,
  type,
  func,
  free 
)
Value:
case JPEG_MARKER_ ## marker: \
{ \
sizeof(type), free); \
if (err < 0) \
return err; \
err = cbs_jpeg_read_ ## func(ctx, &gbc, unit->content); \
if (err < 0) \
return err; \
} \
break
int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, size_t size, void(*free)(void *opaque, uint8_t *data))
Definition: cbs.c:588
GLint GLenum type
Definition: opengl_enc.c:104
AVFormatContext * ctx
Definition: movenc.c:48
if(ret)
int(* func)(AVBPrint *dst, const char *in, const char *arg)
Definition: jacosubdec.c:67
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return

Referenced by cbs_jpeg_read_unit(), and cbs_jpeg_write_segment().

#define SEGMENT (   marker,
  func 
)
Value:
case JPEG_MARKER_ ## marker: \
err = cbs_jpeg_write_ ## func(ctx, pbc, unit->content); \
break;
AVFormatContext * ctx
Definition: movenc.c:48
int(* func)(AVBPrint *dst, const char *in, const char *arg)
Definition: jacosubdec.c:67

Function Documentation

static void cbs_jpeg_free_application_data ( void opaque,
uint8_t content 
)
static

Definition at line 85 of file cbs_jpeg.c.

Referenced by cbs_jpeg_read_unit().

static void cbs_jpeg_free_comment ( void opaque,
uint8_t content 
)
static

Definition at line 92 of file cbs_jpeg.c.

Referenced by cbs_jpeg_read_unit().

static void cbs_jpeg_free_scan ( void opaque,
uint8_t content 
)
static

Definition at line 99 of file cbs_jpeg.c.

Referenced by cbs_jpeg_read_unit().

static int cbs_jpeg_split_fragment ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag,
int  header 
)
static

Definition at line 106 of file cbs_jpeg.c.

static int cbs_jpeg_read_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit 
)
static

Definition at line 243 of file cbs_jpeg.c.

static int cbs_jpeg_write_scan ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit,
PutBitContext pbc 
)
static

Definition at line 328 of file cbs_jpeg.c.

Referenced by cbs_jpeg_write_unit().

static int cbs_jpeg_write_segment ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit,
PutBitContext pbc 
)
static

Definition at line 350 of file cbs_jpeg.c.

Referenced by cbs_jpeg_write_unit().

static int cbs_jpeg_write_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit 
)
static

Definition at line 379 of file cbs_jpeg.c.

static int cbs_jpeg_assemble_fragment ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag 
)
static

Definition at line 434 of file cbs_jpeg.c.

static void cbs_jpeg_close ( CodedBitstreamContext ctx)
static

Definition at line 502 of file cbs_jpeg.c.

Variable Documentation

const CodedBitstreamType ff_cbs_type_jpeg
Initial value:
= {
.codec_id = AV_CODEC_ID_MJPEG,
.priv_data_size = sizeof(CodedBitstreamJPEGContext),
.split_fragment = &cbs_jpeg_split_fragment,
.read_unit = &cbs_jpeg_read_unit,
.write_unit = &cbs_jpeg_write_unit,
.assemble_fragment = &cbs_jpeg_assemble_fragment,
.close = &cbs_jpeg_close,
}
static int cbs_jpeg_read_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_jpeg.c:243
static void cbs_jpeg_close(CodedBitstreamContext *ctx)
Definition: cbs_jpeg.c:502
static int cbs_jpeg_write_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_jpeg.c:379
static int cbs_jpeg_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_jpeg.c:434
static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_jpeg.c:106

Definition at line 509 of file cbs_jpeg.c.