diff options
author | jstebbins <[email protected]> | 2014-12-16 16:50:50 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-12-16 16:50:50 +0000 |
commit | f56efd7b52c89da8cac55b4d4a187f2c87fdfee6 (patch) | |
tree | 24eacb856704fa8e4b8b8f0edc76568916f70255 /libhb/common.h | |
parent | d0a975e42dcab93e1d2eead350fb1ba3951d977c (diff) |
json: add json APIs
There are several changes to job and title structs that break
current windows interop code. The interop code should be changed
such that it only uses json APIs. So if there is any missing
features (or bugs) in these APIs, please let me know.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6602 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.h')
-rw-r--r-- | libhb/common.h | 202 |
1 files changed, 92 insertions, 110 deletions
diff --git a/libhb/common.h b/libhb/common.h index 77a5b9b31..1b86cf4e1 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -79,7 +79,7 @@ typedef struct hb_encoder_s hb_encoder_t; typedef struct hb_container_s hb_container_t; typedef struct hb_rational_s hb_rational_t; typedef struct hb_geometry_s hb_geometry_t; -typedef struct hb_ui_geometry_s hb_ui_geometry_t; +typedef struct hb_geometry_settings_s hb_geometry_settings_t; typedef struct hb_image_s hb_image_t; typedef struct hb_job_s hb_job_t; typedef struct hb_title_set_s hb_title_set_t; @@ -250,19 +250,16 @@ struct hb_geometry_s hb_rational_t par; }; -struct hb_ui_geometry_s +struct hb_geometry_settings_s { int mode; // Anamorphic mode, see job struct anamorphic int keep; // Specifies settings that shouldn't be changed int itu_par; // use dvd dimensions to determine PAR int modulus; // pixel alignment for loose anamorphic int crop[4]; // Pixels cropped from source before scaling - int width; // destination storage width - int height; // destination storage height int maxWidth; // max destination storage width int maxHeight; // max destination storage height - hb_rational_t par; // Pixel aspect used in custom anamorphic - hb_rational_t dar; // Display aspect used in custom anamorphic + hb_geometry_t geometry; }; struct hb_image_s @@ -460,45 +457,41 @@ struct hb_job_s /* Include chapter marker track in mp4? */ int chapter_markers; - /* Picture settings: - crop: must be multiples of 2 (top/bottom/left/right) - deinterlace: 0 or 1 - width: must be a multiple of 2 - height: must be a multiple of 2 - grayscale: black and white encoding - pixel_ratio: store pixel aspect ratio in the video - pixel_aspect_width: numerator for pixel aspect ratio - pixel_aspect_height: denominator for pixel aspect ratio - modulus: set a number for dimensions to be multiples of - maxWidth: keep width below this - maxHeight: keep height below this */ - int crop[4]; - int deinterlace; + // Video filters + int grayscale; // Black and white encoding hb_list_t * list_filter; + +// These job settings should be depricated, but the mac ui is still using them. +// hb_set_anamorphic_mode2 should be used during job setup which makes +// these settings unnecessary +#define HB_DEPRECATE_JOB_SETTINGS +#ifdef HB_DEPRECATE_JOB_SETTINGS + int crop[4]; int width; int height; - int grayscale; + hb_rational_t par; + int modulus; + int maxWidth; + int maxHeight; struct { hb_anamorphic_mode_t mode; int itu_par; - int par_width; - int par_height; - int dar_width; // 0 if normal - int dar_height; // 0 if normal int keep_display_aspect; } anamorphic; - - int modulus; - int maxWidth; - int maxHeight; +#else + PRIVATE int crop[4]; + PRIVATE int width; + PRIVATE int height; + hb_rational_t par; +#endif /* Video settings: vcodec: output codec vquality: output quality (if < 0.0, bitrate is used instead) vbitrate: output bitrate (Kbps) - vrate, vrate_base: output framerate is vrate / vrate_base + vrate: output framerate cfr: 0 (vfr), 1 (cfr), 2 (pfr) [see render.c] pass: 0, 1 or 2 (or -1 for scan) areBframes: boolean to note if b-frames are used */ @@ -515,10 +508,9 @@ struct hb_job_s #define HB_VCODEC_H264_MASK (HB_VCODEC_X264|HB_VCODEC_QSV_H264) int vcodec; - float vquality; + double vquality; int vbitrate; - int vrate; - int vrate_base; + hb_rational_t vrate; int cfr; int pass; int fastfirstpass; @@ -718,8 +710,8 @@ struct hb_audio_config_s int samplerate; /* Output sample rate (Hz) */ int samples_per_frame; /* Number of samples per frame */ int bitrate; /* Output bitrate (Kbps) */ - float quality; /* Output quality (encoder-specific) */ - float compression_level; /* Output compression level (encoder-specific) */ + double quality; /* Output quality (encoder-specific) */ + double compression_level; /* Output compression level (encoder-specific) */ double dynamic_range_compression; /* Amount of DRC applied to this track */ double gain; /* Gain (in dB), negative is quieter */ int normalize_mix_level; /* mix level normalization (boolean) */ @@ -920,79 +912,75 @@ struct hb_metadata_s struct hb_title_s { enum { HB_DVD_TYPE, HB_BD_TYPE, HB_STREAM_TYPE, HB_FF_STREAM_TYPE } type; - uint32_t reg_desc; - char path[1024]; - char name[1024]; - int index; - int playlist; - int vts; - int ttn; - int cell_start; - int cell_end; - uint64_t block_start; - uint64_t block_end; - uint64_t block_count; - int angle_count; - void *opaque_priv; + uint32_t reg_desc; + char path[1024]; + char name[1024]; + int index; + int playlist; + int vts; + int ttn; + int cell_start; + int cell_end; + uint64_t block_start; + uint64_t block_end; + uint64_t block_count; + int angle_count; + void * opaque_priv; /* Visual-friendly duration */ - int hours; - int minutes; - int seconds; + int hours; + int minutes; + int seconds; /* Exact duration (in 1/90000s) */ - uint64_t duration; - - double aspect; // aspect ratio for the title's video - double container_aspect; // aspect ratio from container (0 if none) - int has_resolution_change; - int width; - int height; - int pixel_aspect_width; - int pixel_aspect_height; - int color_prim; - int color_transfer; - int color_matrix; - int rate; - int rate_base; - int crop[4]; + uint64_t duration; + + int has_resolution_change; + hb_geometry_t geometry; + hb_rational_t dar; // aspect ratio for the title's video + hb_rational_t container_dar; // aspect ratio from container (0 if none) + int color_prim; + int color_transfer; + int color_matrix; + hb_rational_t vrate; + int crop[4]; enum {HB_DVD_DEMUXER, HB_TS_DEMUXER, HB_PS_DEMUXER, HB_NULL_DEMUXER} demuxer; - int detected_interlacing; - int pcr_pid; /* PCR PID for TS streams */ - int video_id; /* demuxer stream id for video */ - int video_codec; /* worker object id of video codec */ - uint32_t video_stream_type; /* stream type from source stream */ - int video_codec_param; /* codec specific config */ - char *video_codec_name; - int video_bitrate; - char *container_name; - int data_rate; + int detected_interlacing; + int pcr_pid; /* PCR PID for TS streams */ + int video_id; /* demuxer stream id for video */ + int video_codec; /* worker object id of video codec */ + uint32_t video_stream_type; /* stream type from source stream */ + int video_codec_param; /* codec specific config */ + char * video_codec_name; + int video_bitrate; + char * container_name; + int data_rate; // additional supported video decoders (e.g. HW-accelerated implementations) - int video_decode_support; + int video_decode_support; #define HB_DECODE_SUPPORT_SW 0x01 // software (libavcodec or mpeg2dec) #define HB_DECODE_SUPPORT_QSV 0x02 // Intel Quick Sync Video - hb_metadata_t *metadata; + hb_metadata_t * metadata; - hb_list_t * list_chapter; - hb_list_t * list_audio; - hb_list_t * list_subtitle; - hb_list_t * list_attachment; + hb_list_t * list_chapter; + hb_list_t * list_audio; + hb_list_t * list_subtitle; + hb_list_t * list_attachment; #define HB_TITLE_JOBS #if defined(HB_TITLE_JOBS) - hb_job_t * job; + hb_job_t * job; #endif - uint32_t flags; + uint32_t flags; // set if video stream doesn't have IDR frames #define HBTF_NO_IDR (1 << 0) #define HBTF_SCAN_COMPLETE (1 << 1) // whether OpenCL scaling is supported for this source - int opencl_support; - int hwd_support; // TODO: merge to video_decode_support + int opencl_support; + int hwd_support; // TODO: merge to video_decode_support }; // Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_state_s.cs when changing this struct @@ -1050,27 +1038,23 @@ struct hb_state_s typedef struct hb_work_info_s { - const char * name; - int profile; - int level; - int bitrate; - int rate; - int rate_base; - uint32_t version; - uint32_t flags; - uint32_t mode; + const char * name; + int profile; + int level; + int bitrate; + hb_rational_t rate; + uint32_t version; + uint32_t flags; + uint32_t mode; union { struct { // info only valid for video decoders - int width; - int height; - int pixel_aspect_width; - int pixel_aspect_height; - int color_prim; - int color_transfer; - int color_matrix; - int video_decode_support; + hb_geometry_t geometry; + int color_prim; + int color_transfer; + int color_matrix; + int video_decode_support; }; struct { // info only valid for audio decoders @@ -1167,13 +1151,9 @@ typedef struct hb_filter_init_s { hb_job_t * job; int pix_fmt; - int width; - int height; - int par_width; - int par_height; + hb_geometry_t geometry; int crop[4]; - int vrate_base; - int vrate; + hb_rational_t vrate; int cfr; int use_dxva; } hb_filter_init_t; @@ -1222,6 +1202,7 @@ struct hb_filter_object_s enum { // for QSV - important to have before other filters + HB_FILTER_FIRST = 1, HB_FILTER_QSV_PRE = 1, // First, filters that may change the framerate (drop or dup frames) @@ -1245,6 +1226,7 @@ enum HB_FILTER_QSV_POST, // default MSDK VPP filter HB_FILTER_QSV, + HB_FILTER_LAST = HB_FILTER_QSV }; hb_filter_object_t * hb_filter_init( int filter_id ); |