diff options
author | jstebbins <[email protected]> | 2015-03-29 16:22:30 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-03-29 16:22:30 +0000 |
commit | 8e9bff8f32423c3ac69986bb3e4d03300d41dd4e (patch) | |
tree | a31260ce3ac5fc295f93f48ca2f7136563aa4455 /libhb/hb.c | |
parent | 168ce686fd837de7fbf20266df31af2ac00c8db1 (diff) |
libhb: Eliminate global variable hb_gui_use_hwd_flag
This global was shared between the CLI and libhb and used as a back door to
force scan and encode passes to use the same ffmpeg context for hardware
decoding. Aside from the fact that this context sharing should not be necessary
and needs fixing, this information belongs in the hb_handle_t that is shared
between the scan and the encode. So put it there and make sure the hb_handle_t
get propagated to where the flag is needed.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7028 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r-- | libhb/hb.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index be4d75b9b..7a7429153 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -68,12 +68,32 @@ struct hb_handle_s hb_interjob_t * interjob; // power management opaque pointer - void *system_sleep_opaque; -} ; + void * system_sleep_opaque; + + // When hardware decoding, scan must also use hardware so that + // libav hardware decode contest is used. So set hardware + // decoding as a global property on the hb instance. + hb_hwd_t hwd; +}; hb_work_object_t * hb_objects = NULL; int hb_instance_counter = 0; +void hb_hwd_set_enable( hb_handle_t *h, uint8_t enable ) +{ + h->hwd.enable = enable; +} + +int hb_hwd_enabled( hb_handle_t *h ) +{ + return h->hwd.enable; +} + +hb_hwd_t * hb_hwd_get_context( hb_handle_t *h ) +{ + return &h->hwd; +} + static void thread_func( void * ); static int ff_lockmgr_cb(void **mutex, enum AVLockOp op) |