FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
rtpdec_jpeg.c File Reference
#include "avformat.h"
#include "rtpdec.h"
#include "rtpdec_formats.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/mjpeg.h"
#include "libavcodec/bytestream.h"

Go to the source code of this file.

Data Structures

struct  PayloadContext
 RTP/JPEG specific private data. More...
 

Functions

static PayloadContextjpeg_new_context (void)
 
static void free_frame_if_needed (PayloadContext *jpeg)
 
static void jpeg_free_context (PayloadContext *jpeg)
 
static int jpeg_create_huffman_table (PutByteContext *p, int table_class, int table_id, const uint8_t *bits_table, const uint8_t *value_table)
 
static void jpeg_put_marker (PutByteContext *pbc, int code)
 
static int jpeg_create_header (uint8_t *buf, int size, uint32_t type, uint32_t w, uint32_t h, const uint8_t *qtable, int nb_qtable)
 
static void create_default_qtables (uint8_t *qtables, uint8_t q)
 
static int jpeg_parse_packet (AVFormatContext *ctx, PayloadContext *jpeg, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
 

Variables

static const uint8_t default_quantizers [128]
 
RTPDynamicProtocolHandler ff_jpeg_dynamic_handler
 

Function Documentation

static PayloadContext* jpeg_new_context ( void  )
static

Definition at line 62 of file rtpdec_jpeg.c.

static void free_frame_if_needed ( PayloadContext jpeg)
inlinestatic

Definition at line 67 of file rtpdec_jpeg.c.

Referenced by jpeg_free_context(), and jpeg_parse_packet().

static void jpeg_free_context ( PayloadContext jpeg)
static

Definition at line 77 of file rtpdec_jpeg.c.

static int jpeg_create_huffman_table ( PutByteContext p,
int  table_class,
int  table_id,
const uint8_t bits_table,
const uint8_t value_table 
)
static

Definition at line 83 of file rtpdec_jpeg.c.

Referenced by jpeg_create_header().

static void jpeg_put_marker ( PutByteContext pbc,
int  code 
)
static

Definition at line 102 of file rtpdec_jpeg.c.

Referenced by jpeg_create_header().

static int jpeg_create_header ( uint8_t buf,
int  size,
uint32_t  type,
uint32_t  w,
uint32_t  h,
const uint8_t qtable,
int  nb_qtable 
)
static

Definition at line 108 of file rtpdec_jpeg.c.

Referenced by jpeg_parse_packet().

static void create_default_qtables ( uint8_t qtables,
uint8_t  q 
)
static

Definition at line 199 of file rtpdec_jpeg.c.

Referenced by jpeg_parse_packet().

static int jpeg_parse_packet ( AVFormatContext ctx,
PayloadContext jpeg,
AVStream st,
AVPacket pkt,
uint32_t *  timestamp,
const uint8_t buf,
int  len,
uint16_t  seq,
int  flags 
)
static

Definition at line 220 of file rtpdec_jpeg.c.

Variable Documentation

const uint8_t default_quantizers[128]
static
Initial value:
= {
16, 11, 12, 14, 12, 10, 16, 14,
13, 14, 18, 17, 16, 19, 24, 40,
26, 24, 22, 22, 24, 49, 35, 37,
29, 40, 58, 51, 61, 60, 57, 51,
56, 55, 64, 72, 92, 78, 64, 68,
87, 69, 55, 56, 80, 109, 81, 87,
95, 98, 103, 104, 103, 62, 77, 113,
121, 112, 100, 120, 92, 101, 103, 99,
17, 18, 18, 24, 21, 24, 47, 26,
26, 47, 99, 66, 56, 66, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99
}

Definition at line 40 of file rtpdec_jpeg.c.

Referenced by create_default_qtables().

RTPDynamicProtocolHandler ff_jpeg_dynamic_handler
Initial value:
= {
.enc_name = "JPEG",
.codec_type = AVMEDIA_TYPE_VIDEO,
.codec_id = AV_CODEC_ID_MJPEG,
.alloc = jpeg_new_context,
.parse_packet = jpeg_parse_packet,
.static_payload_id = 26,
}

Definition at line 384 of file rtpdec_jpeg.c.

Referenced by av_register_rtp_dynamic_payload_handlers().