summaryrefslogtreecommitdiffstats
path: root/libhb/scan.c
Commit message (Collapse)AuthorAgeFilesLines
* libhb: Eliminate global variable hb_gui_use_hwd_flagjstebbins2015-03-291-13/+13
| | | | | | | | | | | | 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
* json: automatically scan title when processing json jobsjstebbins2015-03-071-2/+21
| | | | | | | | | | | | | | | Simplifies the WinGui. This also changes how jobs are processed. Creating the sub-jobs for multiple passes is delayed until after scanning and immediately before running the job. Working status has also changed. Sub-job passes are identified in status with an ID that allows the frontend to definitively identify what pass is in progress. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6976 b64f7644-9d1e-0410-96f1-a4d463321fa5
* New audio output options.Rodeo2015-02-151-0/+13
| | | | | | | | | Dolby Digital Plus (E-AC-3), Dolby TrueHD and FLAC can now be passed through without re-encoding. They aren't covered by Auto Passthru yet, however. In addition, encoding to E-AC-3 is now possible. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6908 b64f7644-9d1e-0410-96f1-a4d463321fa5
* scan: work around libav mpeg2 dummy first framejstebbins2015-02-151-1/+11
| | | | | | | | | | libav generates a dummy first frame after any seek for some mpeg2 streams. This results in black preview frames and invalid autocrop values. So always decode at least 2 frames before using the frame for preview. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6906 b64f7644-9d1e-0410-96f1-a4d463321fa5
* scan: improve preview generation for short videos that have no IDRsjstebbins2015-02-021-1/+14
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6862 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update year to 2015.bradleys2015-02-011-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6852 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: remove dead codejstebbins2014-12-231-3/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6646 b64f7644-9d1e-0410-96f1-a4d463321fa5
* json: add json APIsjstebbins2014-12-161-49/+57
| | | | | | | | | | 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
* scan: potential fix for missing audio tracksjstebbins2014-12-121-2/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6597 b64f7644-9d1e-0410-96f1-a4d463321fa5
* scan: eliminate duplicate activity log stream infojstebbins2014-11-171-2/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6525 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: improve CC detectionjstebbins2014-10-281-7/+15
| | | | | | | | | We are failing to detect CCs in some sources because the CC data is not present on every frame. Makes scan always decode a few extra frames to give the decode a better chance of seeing the CC data. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6471 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: improve preview generateion when there are no IDRsjstebbins2014-10-021-0/+17
| | | | | | | | | | Puts the decoder into a mode that returns *all* frames. I.e. it won't just scan to the end of the file looking for an IDR. Then we decode multiple frames (up to 100) searching for an I frame. This way, the reconstructed frame we use for a preview is more likely to be complete. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6430 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix scanning of video that is a single GOPjstebbins2014-09-091-14/+47
| | | | | | | | | | With this type of stream, scan only successfully decodes 1 frame. Eliminating the flush after seek allows decoding more frames. Note that there is a side effect of allowing some junk frames to be decoded, so we only skip the flush if normal scanning finds only 1 frame. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6396 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Fix decoding avi with palettejstebbins2014-05-291-7/+14
| | | | | | | | | ... and probably other formats that use a palette. The palette is stored in AVPacket side data which we did not read. So read the side data and stash it in hb_buffer_t so that it can be used later by the decoder. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6207 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix fps calculation when number of previews is very smalljstebbins2014-03-161-3/+3
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6116 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: remove a52decjstebbins2014-02-201-1/+0
| | | | | | | replace it with libavcodec ac3 decoder git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6049 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update some copyright dates to 2014.Rodeo2014-02-181-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6042 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: support AV_FRAME_DATA_MATRIXENCODING side data.Rodeo2014-01-261-5/+35
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6000 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: set audio description in LookForAudio (scan.c).Rodeo2014-01-251-1/+110
| | | | | | | | | All audio tracks go through it since SVN revision 5424. This is where we have the most information about each audio track. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5996 b64f7644-9d1e-0410-96f1-a4d463321fa5
* remove contrib mpeg2decjstebbins2014-01-131-7/+4
| | | | | | | | We no longer need mpeg2dec. libav now has all the features we need for mpeg2 decoding. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5966 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix reporting of buffer allocation statistics during scanjstebbins2013-11-181-2/+1
| | | | | | | | Put hb_buffer_pool_free() in the right position after all buffers allocated during scan are free. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5895 b64f7644-9d1e-0410-96f1-a4d463321fa5
* OpenCL: use the new library loading architecture for all OpenCL code.Rodeo2013-11-081-0/+4
| | | | | | | | | | | An OpenCL SDK is no longer needed to build OpenCL support. Note: as a result, the --enable-opencl configure option is removed. Also, libOpenCL is no longer needed to run the application (it is still necessary to use OpenCL features, of course). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5886 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Plug some leaks and clean up the buffer pool code a little.jstebbins2013-10-231-0/+2
| | | | | | | | | | | Filters were leaking buffers when a job is cancelled. decavcodec could leak when job cancelled. decavcodec leaked audio extradata in BSInfo encavcodec and encavcodecaudio leaked AVCodecContext sync leaked subtitle_sanitizer_t data git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5853 b64f7644-9d1e-0410-96f1-a4d463321fa5
* QSV: minor refactoring.Rodeo2013-09-151-3/+1
| | | | | | | | | | Address the easy issues first. Apologies if I broke HandBrakeInterop. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5783 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Big merge, QSV to trunk: part 1 (tracked files).Rodeo2013-08-221-0/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5737 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't expose rate, mixdown, dither and encoder arrays to the UIs.Rodeo2013-05-301-3/+4
| | | | | | | | | | | | | | | | | | | | - instead, make these lists available through enumerators: --> hb_*_get_next(<type> *last); - this should give us more flexibility to populate the lists at runtime, using the implementation(s) of our choice, whether they use arrays or not, without requiring UI modifications - use consistent naming for getters --> hb_get_best_foo() becomes hb_foo_get_best(), and so on - hb_*_get_from_name() and hb_*_ sanitize_name() sanitize the requested value to a supported one if it's unavailable - adds an additional, passthru-specific fallback mechanism - adds a list of video containers git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5526 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Refactor add_ffmpeg_audio.Rodeo2013-04-281-0/+1
| | | | | | | | | | | Simplify, set bitrate to 0 - scan will then call decavcodecaBSInfo, decode some audio and set the other input parameters, including samples_per_frame. decavcodec and scan fixes by John Stebbins. Thanks! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5424 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix incorrect scan progressjstebbins2013-03-141-2/+2
| | | | | | | slightly wrong calculation caused progress to go backwards sometimes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5328 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Updated all the copyright headers to 2013.sr552013-03-091-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5318 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve scan progress granularityjstebbins2013-03-011-13/+71
| | | | | | | | We were only updating progress after completely processing each title. Now progress is updated as we generate previews as well. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5276 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bump libav to v9_beta3.Rodeo2012-12-311-3/+4
| | | | | | | | Miscellaneous bugfixes and improvements. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5124 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve management of titles and jobsjstebbins2012-11-121-73/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleans up several several unavoidable memory leaks caused by old api. Clearly separates titles from jobs. Titles are set during scan and never modified now. Since titles are immutable, this lead to API some changes. For example, We were setting chapter names in the title from the front ends. Now these get set in the job. These new APIs allow us to start moving away from our use of title->job. Eventually, I would like to eliminate title->job completely, but the mac ui is too tightly tied to using this field to allow removing it at this time. So there is temporarily a convenience function used only by the mac ui that allows it to continue using title->job and also use the new APIs. New APIs: typedef struct hb_title_set_s hb_title_set_t; struct hb_title_set_s { hb_list_t * list_title; int feature; // Detected DVD feature title }; hb_title_set_t * hb_get_title_set( hb_handle_t * ); This is just something I added to clean up how "feature title" info is passed. hb_job_t * hb_job_init( hb_title_t * title ); Initializes a new job with default settings from the title. hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index ); Same as hb_job_init(). For use by win Interop lib. void hb_job_reset( hb_job_t * job ); Convenience function for the MacUi. Clears audio, subtitle, and filter lists. The macui still uses title->job because it is so intricately tied to it. So I created this convenience function that it can call after adding a job. void hb_job_close( hb_job_t ** job ); Releases the job an all resources it contains. void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts ); Makes a copy of "advanced_opts" and stores in job. Freed by hb_job_close(). void hb_job_set_file( hb_job_t *job, const char *file ); Makes a copy of "file" and stores in job. Freed by hb_job_close(). void hb_chapter_set_title(hb_chapter_t *chapter, const char *title); Makes a copy of "title" and stores in chapter. Freed by hb_chapter_close(). Recommended usage (cli and lingui are updated to do this): job = hb_job_init( title ); // set job settings ... hb_add(h, job); hb_job_close( &job ); I have also added new APIs for managing metadata. These are used to add metadata to a job. void hb_metadata_set_name( hb_metadata_t *metadata, const char *name ); void hb_metadata_set_artist( hb_metadata_t *metadata, const char *artist ); void hb_metadata_set_composer( hb_metadata_t *metadata, const char *composer ); void hb_metadata_set_release_date( hb_metadata_t *metadata, const char *release_date ); void hb_metadata_set_comment( hb_metadata_t *metadata, const char *comment ); void hb_metadata_set_genre( hb_metadata_t *metadata, const char *genre ); void hb_metadata_set_album( hb_metadata_t *metadata, const char *album ); void hb_metadata_set_coverart( hb_metadata_t *metadata, const uint8_t *coverart, int size ); Example: job = hb_job_init( &job ); // set job settings ... hb_metadata_set_artist( job->metadata, "Danny Elfman" ); hb_add(h, job); hb_job_close( &job ); Some APIs have changed in order to avoid using title incorrectly and use the new hb_title_set_t. -void hb_autopassthru_apply_settings( hb_job_t * job, hb_title_t * title ); +void hb_autopassthru_apply_settings( hb_job_t * job ); -void hb_get_preview( hb_handle_t *, hb_title_t *, int, uint8_t * ); +void hb_get_preview( hb_handle_t *, hb_job_t *, int, uint8_t * ); hb_thread_t * hb_scan_init( hb_handle_t *, volatile int * die, const char * path, int title_index, - hb_list_t * list_title, int preview_count, + hb_title_set_t * title_set, int preview_count, int store_previews, uint64_t min_duration ); These APIs have been removed. Win Interop will need some changes. I think what I've provided will be suffecient, but let me know if it's not. -void hb_get_preview_by_index( hb_handle_t *, int, int, uint8_t * ); -void hb_set_anamorphic_size_by_index( hb_handle_t *, int, - int *output_width, int *output_height, - int *output_par_width, int *output_par_height ); git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5058 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use libav for dts audio decoding instead of libdca jstebbins2012-07-151-1/+0
| | | | | | | | | libdca has no advantage over libav for dts audio decoding. It doesn't do drc and it's downmix capabilities are actually inferior to libav. So this completely removes libdca from libhb git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4844 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix comb detection crash and decomb crashjstebbins2012-07-061-1/+1
| | | | | | | | | | | | | hb_detect_comb() could crash because the dimensions of the video buffer don't have to match the dimensions returned by work object info() method if the video has segments of differeing resolutions. decomb was allocating reference buffers that were too small. This bug appears to have always existed but doesn't usually get triggered because malloc usually rounds allocation sizes up. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4812 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix unused variable warningjstebbins2012-07-021-1/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4806 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix crop detectionjstebbins2012-06-301-17/+18
| | | | | | | It wasn't accounting for stride that is greater than width git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4803 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: drop HB_INPUT_CH_LAYOUT_*Rodeo2012-06-181-10/+8
| | | | | | | | AV_CH_LAYOUT_* works for us, and as its usage becomes more widespread in libhb, translating between the two formats gets increasingly tedious. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4754 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Updated file copyright / GPL headerssr552012-06-151-3/+6
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4737 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decdca: attempt to fix Dolby Surround and Pro Logic II mixdown. We were ↵Rodeo2012-05-271-2/+2
| | | | | | | | | | | | | | doing it wrong in some cases. This means Dolby Pro Logic II is now only available for sources with at least L, R, C, Ls, Rs channels (as well as any additional channels), due to some libdca limitations. This will eventually go away when we use our own downmixing for all sources. Further cleanup to follow. Also cleans up usage of audio->config.in.flags (was audio->config.flags.*). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4705 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Scan: fix some 24000/1001 sources being detected as "almost" 24000/1001, ↵Rodeo2012-05-021-1/+12
| | | | | | using is_close_to(). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4631 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: allow arbitrary number of preview images, fixes potential crashjstebbins2012-05-011-9/+28
| | | | | | | | | scan.c had a limit of 30 previews due to fixed array size. But test.c didn't limit the max number of previews, so it was possible to generate a crash by specifying > 30. This removes the limitation. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4616 b64f7644-9d1e-0410-96f1-a4d463321fa5
* PGS (bluray) subtitle support \o/jstebbins2012-04-261-1/+1
| | | | | | | | | | | | Thanks to patches supplied by David Mitchell and Rob McMullen we finally have PGS support. I added a fix for libav pgs timestamp processing and detection of forced subtitles to their work, then made foreign audio search work with PGS subs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4605 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: use source colorimetry information when available.Rodeo2012-03-281-0/+3
| | | | | | | | | When source colorimetry can't be determined, guess. Added code to guess PAL SD content and updated code to guess HD content. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4552 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rework filter pipelinejstebbins2012-03-271-20/+6
| | | | | | | | | | | | | | | | | | | | This patch enhances the filter objects. The 2 key improvements are: 1. A filter can change the image dimensions as frames pass through it. 2. A filter can output more than one frame. In addition, I have: Moved cropping & scalling into a filter object Added 90 degree rotation to the rotate filter Moved subtitle burn-in rendering to a filter object. Moved VFR/CFR handling into a framerate shaping filter object. Removed render.c since all it's responsibilities got moved to filters. Improves VOBSUB and SSA subtitle handling. Allows subtitle animations. SSA karaoke support. My apologies in advance if anything breaks ;) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4546 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add path to log when decoding previews in batch scanjstebbins2011-12-291-1/+8
| | | | | | The title number isn't very helpful in batch scan mode. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4391 b64f7644-9d1e-0410-96f1-a4d463321fa5
* use more sensitive threshold for pullup detectionjstebbins2011-10-251-1/+1
| | | | | | | This improves our accuracy at detecting the framerate of telecined material. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4320 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a problem with resolution changes in h.264jstebbins2011-10-171-0/+17
| | | | | | | | | | | | First, the scaling code in decavcodec.c was broken and didn't properly compensate for frames that had a different resolution than the rest of the stream. Second, libav can not handle resolution changes when doing frame based multi-threading. So disable threading when resolution changes are detected. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4295 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix silly patch errorjstebbins2011-09-241-1/+1
| | | | | | | i let part of another patch leak in git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4243 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix framerate detection for AVCHD-Litejstebbins2011-09-241-4/+20
| | | | | | | | The AVCHD-Lite specification only supports 50 or 60 fps. So to get 25 or 30 fps, they double every frame using repeat flags. Detect this and adjust the framerate accordingly. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4242 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix corrupt first frame in BD point-to-pointjstebbins2011-09-191-31/+0
| | | | | | | | | | | Seek point may be a recovery point which will not be a complete clean frame. So consume frames till we reach the recovery frame count. Patches Libav so it can tell us when the recovery point has been reached. Also improves detection of recovery points in TS files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4231 b64f7644-9d1e-0410-96f1-a4d463321fa5