FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
crystalhd.c File Reference
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <libcrystalhd/bc_dts_types.h>
#include <libcrystalhd/bc_dts_defs.h>
#include <libcrystalhd/libcrystalhd_if.h>
#include "avcodec.h"
#include "h264dec.h"
#include "internal.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  OpaqueList
 
struct  CHDContext
 

Macros

#define _XOPEN_SOURCE   600
 
#define OUTPUT_PROC_TIMEOUT   50
 Timeout parameter passed to DtsProcOutput() in us. More...
 
#define TIMESTAMP_UNIT   100000
 Step between fake timestamps passed to hardware in units of 100ns. More...
 
#define BASE_WAIT   10000
 Initial value in us of the wait in decode() More...
 
#define WAIT_UNIT   1000
 Increment in us to adjust wait in decode() More...
 

Enumerations

enum  CopyRet {
  RET_ERROR = -1, RET_OK = 0, RET_COPY_AGAIN = 1, RET_SKIP_NEXT_COPY = 2,
  RET_COPY_NEXT_FIELD = 3
}
 

Functions

static BC_MEDIA_SUBTYPE id2subtype (CHDContext *priv, enum AVCodecID id)
 
static void print_frame_info (CHDContext *priv, BC_DTS_PROC_OUT *output)
 
static uint64_t opaque_list_push (CHDContext *priv, uint64_t reordered_opaque, uint8_t pic_type)
 
static OpaqueListopaque_list_pop (CHDContext *priv, uint64_t fake_timestamp)
 
static void flush (AVCodecContext *avctx)
 
static av_cold int uninit (AVCodecContext *avctx)
 
static av_cold int init_bsf (AVCodecContext *avctx, const char *bsf_name)
 
static av_cold int init (AVCodecContext *avctx)
 
static CopyRet copy_frame (AVCodecContext *avctx, BC_DTS_PROC_OUT *output, void *data, int *got_frame)
 
static CopyRet receive_frame (AVCodecContext *avctx, void *data, int *got_frame)
 
static int decode (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 

Variables

static const AVOption options []
 

Macro Definition Documentation

#define _XOPEN_SOURCE   600

Definition at line 76 of file crystalhd.c.

#define OUTPUT_PROC_TIMEOUT   50

Timeout parameter passed to DtsProcOutput() in us.

Definition at line 97 of file crystalhd.c.

Referenced by receive_frame().

#define TIMESTAMP_UNIT   100000

Step between fake timestamps passed to hardware in units of 100ns.

Definition at line 99 of file crystalhd.c.

Referenced by opaque_list_push().

#define BASE_WAIT   10000

Initial value in us of the wait in decode()

Definition at line 101 of file crystalhd.c.

Referenced by decode(), flush(), and init().

#define WAIT_UNIT   1000

Increment in us to adjust wait in decode()

Definition at line 103 of file crystalhd.c.

Referenced by decode().

Enumeration Type Documentation

enum CopyRet
Enumerator
RET_ERROR 
RET_OK 
RET_COPY_AGAIN 
RET_SKIP_NEXT_COPY 
RET_COPY_NEXT_FIELD 

Definition at line 110 of file crystalhd.c.

Function Documentation

static BC_MEDIA_SUBTYPE id2subtype ( CHDContext priv,
enum AVCodecID  id 
)
inlinestatic

Definition at line 169 of file crystalhd.c.

Referenced by init().

static void print_frame_info ( CHDContext priv,
BC_DTS_PROC_OUT *  output 
)
inlinestatic

Definition at line 189 of file crystalhd.c.

Referenced by receive_frame().

static uint64_t opaque_list_push ( CHDContext priv,
uint64_t  reordered_opaque,
uint8_t  pic_type 
)
static

Definition at line 235 of file crystalhd.c.

Referenced by decode().

static OpaqueList* opaque_list_pop ( CHDContext priv,
uint64_t  fake_timestamp 
)
static

Definition at line 265 of file crystalhd.c.

Referenced by copy_frame().

static void flush ( AVCodecContext avctx)
static

Definition at line 318 of file crystalhd.c.

static av_cold int uninit ( AVCodecContext avctx)
static

Definition at line 336 of file crystalhd.c.

Referenced by init().

static av_cold int init_bsf ( AVCodecContext avctx,
const char *  bsf_name 
)
static

Definition at line 381 of file crystalhd.c.

Referenced by init().

static av_cold int init ( AVCodecContext avctx)
static

Definition at line 430 of file crystalhd.c.

static CopyRet copy_frame ( AVCodecContext avctx,
BC_DTS_PROC_OUT *  output,
void data,
int *  got_frame 
)
inlinestatic

Definition at line 579 of file crystalhd.c.

Referenced by receive_frame().

static CopyRet receive_frame ( AVCodecContext avctx,
void data,
int *  got_frame 
)
inlinestatic

Definition at line 785 of file crystalhd.c.

Referenced by decode().

static int decode ( AVCodecContext avctx,
void data,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 912 of file crystalhd.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "crystalhd_downscale_width",
"Turn on downscaling to the specified width",
0x42,
AV_OPT_TYPE_INT, {.i64 = 0}, 0, UINT32_MAX,
{ NULL, },
}
#define NULL
Definition: coverity.c:32
#define AV_OPT_FLAG_VIDEO_PARAM
Definition: opt.h:281
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:276

Definition at line 155 of file crystalhd.c.