Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
00507b0d
Commit
00507b0d
authored
Apr 28, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/mux/ogg.c, modules/codec/theora.c: changes for theora alpha 3 support + misc small fixes.
parent
214024cc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
16 deletions
+32
-16
modules/codec/theora.c
modules/codec/theora.c
+15
-11
modules/mux/ogg.c
modules/mux/ogg.c
+17
-5
No files found.
modules/codec/theora.c
View file @
00507b0d
...
@@ -492,22 +492,26 @@ static int OpenEncoder( vlc_object_t *p_this )
...
@@ -492,22 +492,26 @@ static int OpenEncoder( vlc_object_t *p_this )
if
(
i_quality
>
10
)
i_quality
=
10
;
if
(
i_quality
>
10
)
i_quality
=
10
;
if
(
i_quality
<
0
)
i_quality
=
0
;
if
(
i_quality
<
0
)
i_quality
=
0
;
#define frame_x_offset 0
#define frame_y_offset 0
#define video_hzn 25
#define video_hzd 1
#define video_q 5
theora_info_init
(
&
p_sys
->
ti
);
theora_info_init
(
&
p_sys
->
ti
);
p_sys
->
ti
.
width
=
p_enc
->
fmt_in
.
video
.
i_width
;
p_sys
->
ti
.
width
=
p_enc
->
fmt_in
.
video
.
i_width
;
p_sys
->
ti
.
height
=
p_enc
->
fmt_in
.
video
.
i_height
;
p_sys
->
ti
.
height
=
p_enc
->
fmt_in
.
video
.
i_height
;
p_sys
->
ti
.
frame_width
=
p_enc
->
fmt_in
.
video
.
i_width
;
p_sys
->
ti
.
frame_width
=
p_enc
->
fmt_in
.
video
.
i_width
;
p_sys
->
ti
.
frame_height
=
p_enc
->
fmt_in
.
video
.
i_height
;
p_sys
->
ti
.
frame_height
=
p_enc
->
fmt_in
.
video
.
i_height
;
p_sys
->
ti
.
offset_x
=
frame_x_offset
;
p_sys
->
ti
.
offset_x
=
0
/*frame_x_offset*/
;
p_sys
->
ti
.
offset_y
=
frame_y_offset
;
p_sys
->
ti
.
offset_y
=
0
/*frame_y_offset*/
;
p_sys
->
ti
.
fps_numerator
=
video_hzn
;
p_sys
->
ti
.
fps_denominator
=
video_hzd
;
if
(
!
p_enc
->
fmt_in
.
video
.
i_frame_rate
||
!
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
)
{
p_sys
->
ti
.
fps_numerator
=
25
;
p_sys
->
ti
.
fps_denominator
=
1
;
}
else
{
p_sys
->
ti
.
fps_numerator
=
p_enc
->
fmt_in
.
video
.
i_frame_rate
;
p_sys
->
ti
.
fps_denominator
=
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
;
}
if
(
p_enc
->
fmt_in
.
video
.
i_aspect
)
if
(
p_enc
->
fmt_in
.
video
.
i_aspect
)
{
{
...
@@ -625,7 +629,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict )
...
@@ -625,7 +629,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict )
/* Ogg packet to block */
/* Ogg packet to block */
p_block
=
block_New
(
p_enc
,
oggpacket
.
bytes
);
p_block
=
block_New
(
p_enc
,
oggpacket
.
bytes
);
memcpy
(
p_block
->
p_buffer
,
oggpacket
.
packet
,
oggpacket
.
bytes
);
memcpy
(
p_block
->
p_buffer
,
oggpacket
.
packet
,
oggpacket
.
bytes
);
p_block
->
i_dts
=
p_block
->
i_pts
=
p_pict
->
date
;
;
p_block
->
i_dts
=
p_block
->
i_pts
=
p_pict
->
date
;
return
p_block
;
return
p_block
;
}
}
...
...
modules/mux/ogg.c
View file @
00507b0d
...
@@ -328,6 +328,14 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -328,6 +328,14 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
switch
(
p_input
->
p_fmt
->
i_cat
)
switch
(
p_input
->
p_fmt
->
i_cat
)
{
{
case
VIDEO_ES
:
case
VIDEO_ES
:
if
(
!
p_input
->
p_fmt
->
video
.
i_frame_rate
||
!
p_input
->
p_fmt
->
video
.
i_frame_rate_base
)
{
msg_Warn
(
p_mux
,
"Missing frame rate, assuming 25fps"
);
p_input
->
p_fmt
->
video
.
i_frame_rate
=
25
;
p_input
->
p_fmt
->
video
.
i_frame_rate_base
=
1
;
}
switch
(
p_stream
->
i_fourcc
)
switch
(
p_stream
->
i_fourcc
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
...
@@ -352,7 +360,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -352,7 +360,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
SetDWLE
(
&
p_stream
->
oggds_header
.
i_size
,
SetDWLE
(
&
p_stream
->
oggds_header
.
i_size
,
sizeof
(
oggds_header_t
)
-
1
);
sizeof
(
oggds_header_t
)
-
1
);
SetQWLE
(
&
p_stream
->
oggds_header
.
i_time_unit
,
SetQWLE
(
&
p_stream
->
oggds_header
.
i_time_unit
,
I64C
(
10000000
)
/
(
int64_t
)
25
);
// FIXME (25fps)
I64C
(
10000000
)
*
p_input
->
p_fmt
->
video
.
i_frame_rate_base
/
(
int64_t
)
p_input
->
p_fmt
->
video
.
i_frame_rate
);
SetQWLE
(
&
p_stream
->
oggds_header
.
i_samples_per_unit
,
1
);
SetQWLE
(
&
p_stream
->
oggds_header
.
i_samples_per_unit
,
1
);
SetDWLE
(
&
p_stream
->
oggds_header
.
i_default_len
,
1
);
/* ??? */
SetDWLE
(
&
p_stream
->
oggds_header
.
i_default_len
,
1
);
/* ??? */
SetDWLE
(
&
p_stream
->
oggds_header
.
i_buffer_size
,
1024
*
1024
);
SetDWLE
(
&
p_stream
->
oggds_header
.
i_buffer_size
,
1024
*
1024
);
...
@@ -597,7 +606,8 @@ static block_t *OggCreateHeader( sout_mux_t *p_mux, mtime_t i_dts )
...
@@ -597,7 +606,8 @@ static block_t *OggCreateHeader( sout_mux_t *p_mux, mtime_t i_dts )
/* Get keyframe_granule_shift for theora granulepos calculation */
/* Get keyframe_granule_shift for theora granulepos calculation */
if
(
p_stream
->
i_fourcc
==
VLC_FOURCC
(
't'
,
'h'
,
'e'
,
'o'
)
)
if
(
p_stream
->
i_fourcc
==
VLC_FOURCC
(
't'
,
'h'
,
'e'
,
'o'
)
)
{
{
int
i_keyframe_frequency_force
=
1
<<
(
op
.
packet
[
36
]
>>
3
);
int
i_keyframe_frequency_force
=
1
<<
((
op
.
packet
[
40
]
<<
6
>>
3
)
|
(
op
.
packet
[
41
]
>>
5
));
/* granule_shift = i_log( frequency_force -1 ) */
/* granule_shift = i_log( frequency_force -1 ) */
p_stream
->
i_keyframe_granule_shift
=
0
;
p_stream
->
i_keyframe_granule_shift
=
0
;
...
@@ -909,9 +919,11 @@ static int Mux( sout_mux_t *p_mux )
...
@@ -909,9 +919,11 @@ static int Mux( sout_mux_t *p_mux )
{
{
if
(
p_stream
->
i_fourcc
==
VLC_FOURCC
(
't'
,
'h'
,
'e'
,
'o'
)
)
if
(
p_stream
->
i_fourcc
==
VLC_FOURCC
(
't'
,
'h'
,
'e'
,
'o'
)
)
{
{
/* FIXME, we assume only keyframes and 25fps */
/* FIXME, we assume only keyframes */
op
.
granulepos
=
(
(
i_dts
-
p_sys
->
i_start_dts
)
*
I64C
(
25
)
op
.
granulepos
=
(
(
i_dts
-
p_sys
->
i_start_dts
)
*
/
I64C
(
1000000
)
)
<<
p_stream
->
i_keyframe_granule_shift
;
p_input
->
p_fmt
->
video
.
i_frame_rate
/
p_input
->
p_fmt
->
video
.
i_frame_rate_base
/
I64C
(
1000000
)
)
<<
p_stream
->
i_keyframe_granule_shift
;
}
}
else
else
op
.
granulepos
=
(
i_dts
-
p_sys
->
i_start_dts
)
*
I64C
(
10
)
/
op
.
granulepos
=
(
i_dts
-
p_sys
->
i_start_dts
)
*
I64C
(
10
)
/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment