Changeset a4056df25a32758069120e7749938397ee0e34b8
- Timestamp:
- 05/17/08 19:42:16
(4 months ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1211046136 +0200
- git-parent:
[453ff82acfa8ec4fb717fe71b094199d8659a1f5]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1211028488 +0200
- Message:
Use the same default values for i_frame_rate everywhere.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r34eab2d |
ra4056df |
|
| 363 | 363 | #define TRANSCODE_FILTERS 10 |
|---|
| 364 | 364 | |
|---|
| | 365 | #define ENC_FRAMERATE (25 * 1000 + .5) |
|---|
| | 366 | #define ENC_FRAMERATE_BASE 1000 |
|---|
| | 367 | |
|---|
| 365 | 368 | struct sout_stream_sys_t |
|---|
| 366 | 369 | { |
|---|
| … | … | |
| 1024 | 1027 | { |
|---|
| 1025 | 1028 | id->p_encoder->fmt_out.video.i_frame_rate = |
|---|
| 1026 | | (p_sys->f_fps * 1001) + 0.5; |
|---|
| 1027 | | id->p_encoder->fmt_out.video.i_frame_rate_base = 1001; |
|---|
| | 1029 | (p_sys->f_fps * 1000) + 0.5; |
|---|
| | 1030 | id->p_encoder->fmt_out.video.i_frame_rate_base = |
|---|
| | 1031 | ENC_FRAMERATE_BASE; |
|---|
| 1028 | 1032 | } |
|---|
| 1029 | 1033 | } |
|---|
| … | … | |
| 1779 | 1783 | id->p_decoder->fmt_in.video.i_height ? |
|---|
| 1780 | 1784 | id->p_decoder->fmt_in.video.i_height : 16; |
|---|
| 1781 | | id->p_encoder->fmt_in.video.i_frame_rate = 25; |
|---|
| 1782 | | id->p_encoder->fmt_in.video.i_frame_rate_base = 1; |
|---|
| | 1785 | id->p_encoder->fmt_in.video.i_frame_rate = ENC_FRAMERATE; |
|---|
| | 1786 | id->p_encoder->fmt_in.video.i_frame_rate_base = ENC_FRAMERATE_BASE; |
|---|
| 1783 | 1787 | |
|---|
| 1784 | 1788 | id->p_encoder->i_threads = p_sys->i_threads; |
|---|
| … | … | |
| 1834 | 1838 | sout_stream_id_t *id ) |
|---|
| 1835 | 1839 | { |
|---|
| 1836 | | sout_stream_sys_t *p_sys = p_stream->p_sys; |
|---|
| 1837 | | |
|---|
| 1838 | | /* Calculate scaling, padding, cropping etc. */ |
|---|
| 1839 | | /* width/height of source */ |
|---|
| | 1840 | sout_stream_sys_t *p_sys = p_stream->p_sys; |
|---|
| | 1841 | |
|---|
| | 1842 | /* Calculate scaling, padding, cropping etc. |
|---|
| | 1843 | * width/height of source */ |
|---|
| 1840 | 1844 | int i_src_width = id->p_decoder->fmt_out.video.i_width; |
|---|
| 1841 | 1845 | int i_src_height = id->p_decoder->fmt_out.video.i_height; |
|---|
| … | … | |
| 1924 | 1928 | f_scale_width = (float)p_sys->i_maxwidth / p_sys->i_crop_width; |
|---|
| 1925 | 1929 | } |
|---|
| | 1930 | |
|---|
| 1926 | 1931 | if( p_sys->i_maxheight && f_scale_height > (float)p_sys->i_maxheight / |
|---|
| 1927 | 1932 | p_sys->i_crop_height ) |
|---|
| … | … | |
| 2072 | 2077 | { |
|---|
| 2073 | 2078 | /* Pick a sensible default value */ |
|---|
| 2074 | | id->p_encoder->fmt_out.video.i_frame_rate = 25; |
|---|
| 2075 | | id->p_encoder->fmt_out.video.i_frame_rate_base = 1; |
|---|
| | 2079 | id->p_encoder->fmt_out.video.i_frame_rate = ENC_FRAMERATE; |
|---|
| | 2080 | id->p_encoder->fmt_out.video.i_frame_rate_base = ENC_FRAMERATE_BASE; |
|---|
| 2076 | 2081 | } |
|---|
| 2077 | 2082 | } |
|---|
| … | … | |
| 2089 | 2094 | if( !id->p_encoder->fmt_out.video.i_aspect ) |
|---|
| 2090 | 2095 | { |
|---|
| 2091 | | id->p_encoder->fmt_out.video.i_aspect = (int)( f_aspect * VOUT_ASPECT_FACTOR + 0.5 ); |
|---|
| | 2096 | id->p_encoder->fmt_out.video.i_aspect = |
|---|
| | 2097 | (int)( f_aspect * VOUT_ASPECT_FACTOR + 0.5 ); |
|---|
| 2092 | 2098 | } |
|---|
| 2093 | 2099 | id->p_encoder->fmt_in.video.i_aspect = |
|---|
| 2094 | 2100 | id->p_encoder->fmt_out.video.i_aspect; |
|---|
| 2095 | 2101 | |
|---|
| 2096 | | msg_Dbg( p_stream, "encoder aspect is %i:%i", id->p_encoder->fmt_out.video.i_aspect, VOUT_ASPECT_FACTOR ); |
|---|
| | 2102 | msg_Dbg( p_stream, "encoder aspect is %i:%i", |
|---|
| | 2103 | id->p_encoder->fmt_out.video.i_aspect, VOUT_ASPECT_FACTOR ); |
|---|
| 2097 | 2104 | |
|---|
| 2098 | 2105 | id->p_encoder->p_module = |
|---|
| … | … | |
| 2257 | 2264 | id->pp_filter[id->i_filter] = |
|---|
| 2258 | 2265 | transcode_video_filter_new( p_stream, |
|---|
| 2259 | | &id->p_decoder->fmt_out, &id->p_decoder->fmt_out, |
|---|
| | 2266 | &id->p_decoder->fmt_out, |
|---|
| | 2267 | &id->p_decoder->fmt_out, |
|---|
| 2260 | 2268 | p_sys->p_deinterlace_cfg, |
|---|
| 2261 | 2269 | p_sys->psz_deinterlace ); |
|---|
| … | … | |
| 2275 | 2283 | id->pp_filter[id->i_filter] = |
|---|
| 2276 | 2284 | transcode_video_filter_new( p_stream, |
|---|
| 2277 | | &id->p_decoder->fmt_out, &id->p_encoder->fmt_in, |
|---|
| | 2285 | &id->p_decoder->fmt_out, |
|---|
| | 2286 | &id->p_encoder->fmt_in, |
|---|
| 2278 | 2287 | NULL, "scale" ); |
|---|
| 2279 | 2288 | if( !id->pp_filter[id->i_filter] ) |
|---|
| … | … | |
| 2309 | 2318 | id->pp_filter[id->i_filter] = |
|---|
| 2310 | 2319 | transcode_video_filter_new( p_stream, |
|---|
| 2311 | | &id->p_decoder->fmt_out, &id->p_encoder->fmt_in, |
|---|
| | 2320 | &id->p_decoder->fmt_out, |
|---|
| | 2321 | &id->p_encoder->fmt_in, |
|---|
| 2312 | 2322 | NULL, "croppadd" ); |
|---|
| 2313 | 2323 | if( id->pp_filter[id->i_filter] ) |
|---|
| … | … | |
| 2343 | 2353 | id->pp_filter[id->i_filter] = |
|---|
| 2344 | 2354 | transcode_video_filter_new( p_stream, |
|---|
| 2345 | | &id->p_decoder->fmt_out, &id->p_encoder->fmt_in, |
|---|
| | 2355 | &id->p_decoder->fmt_out, |
|---|
| | 2356 | &id->p_encoder->fmt_in, |
|---|
| 2346 | 2357 | NULL, "crop padd" ); |
|---|
| 2347 | 2358 | if( !id->pp_filter[id->i_filter] ) |
|---|