Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 83 lines (70 sloc) 2.333 kB
6b3087c Update file headers throughout x264
Jason Garrett-Glaser authored
1 /*****************************************************************************
ce052b8 @kemuri-9 Centralize logging within x264cli
kemuri-9 authored
2 * x264cli.h: x264cli common
6b3087c Update file headers throughout x264
Jason Garrett-Glaser authored
3 *****************************************************************************
83c371d Bump dates to 2012
Hii authored
4 * Copyright (C) 2003-2012 x264 project
6b3087c Update file headers throughout x264
Jason Garrett-Glaser authored
5 *
6 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
7 * Loren Merritt <lorenm@u.washington.edu>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
0596dff Update source file headers
Jason Garrett-Glaser authored
22 *
23 * This program is also available under a commercial proprietary license.
24 * For more information, contact us at licensing@x264.com.
6b3087c Update file headers throughout x264
Jason Garrett-Glaser authored
25 *****************************************************************************/
26
ce052b8 @kemuri-9 Centralize logging within x264cli
kemuri-9 authored
27 #ifndef X264_CLI_H
28 #define X264_CLI_H
058c3be cosmetics: muxers -> muxers.c
Loren Merritt authored
29
6169a3f @kemuri-9 split muxers.c into one file per format
kemuri-9 authored
30 #include "common/common.h"
058c3be cosmetics: muxers -> muxers.c
Loren Merritt authored
31
e6738f2 Improve update interval of x264cli progress information
Jason Garrett-Glaser authored
32 /* In microseconds */
33 #define UPDATE_INTERVAL 250000
34
6169a3f @kemuri-9 split muxers.c into one file per format
kemuri-9 authored
35 typedef void *hnd_t;
058c3be cosmetics: muxers -> muxers.c
Loren Merritt authored
36
62dfb25 Cosmetics: fix some signedness issues found by -Wsign-compare
Jason Garrett-Glaser authored
37 static inline uint64_t gcd( uint64_t a, uint64_t b )
6169a3f @kemuri-9 split muxers.c into one file per format
kemuri-9 authored
38 {
39 while( 1 )
40 {
41 int64_t c = a % b;
42 if( !c )
43 return b;
44 a = b;
45 b = c;
46 }
47 }
48
62dfb25 Cosmetics: fix some signedness issues found by -Wsign-compare
Jason Garrett-Glaser authored
49 static inline uint64_t lcm( uint64_t a, uint64_t b )
a5f5690 @VFR-maniac Timecode input/output
VFR-maniac authored
50 {
51 return ( a / gcd( a, b ) ) * b;
52 }
53
380a201 @kemuri-9 Enhanced Avisynth input support
kemuri-9 authored
54 static inline char *get_filename_extension( char *filename )
55 {
56 char *ext = filename + strlen( filename );
57 while( *ext != '.' && ext > filename )
58 ext--;
59 ext += *ext == '.';
60 return ext;
61 }
62
ce052b8 @kemuri-9 Centralize logging within x264cli
kemuri-9 authored
63 void x264_cli_log( const char *name, int i_level, const char *fmt, ... );
64 void x264_cli_printf( int i_level, const char *fmt, ... );
65
d797a1b @kemuri-9 Add video filtering system to x264cli
kemuri-9 authored
66 #define RETURN_IF_ERR( cond, name, ret, ... )\
ce052b8 @kemuri-9 Centralize logging within x264cli
kemuri-9 authored
67 if( cond )\
68 {\
69 x264_cli_log( name, X264_LOG_ERROR, __VA_ARGS__ );\
d797a1b @kemuri-9 Add video filtering system to x264cli
kemuri-9 authored
70 return ret;\
ce052b8 @kemuri-9 Centralize logging within x264cli
kemuri-9 authored
71 }
36c25b6 if --threads > 1, then read the input stream in its own thread.
Loren Merritt authored
72
d797a1b @kemuri-9 Add video filtering system to x264cli
kemuri-9 authored
73 #define FAIL_IF_ERR( cond, name, ... ) RETURN_IF_ERR( cond, name, -1, __VA_ARGS__ )
74
e047b3c @kemuri-9 YUV range detection and support for x264CLI
kemuri-9 authored
75 typedef enum
76 {
77 RANGE_AUTO = -1,
78 RANGE_TV,
79 RANGE_PC
80 } range_enum;
81
058c3be cosmetics: muxers -> muxers.c
Loren Merritt authored
82 #endif
Something went wrong with that request. Please try again.