Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
73f01617
Commit
73f01617
authored
Feb 10, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TS Mux GetPMT(): factor out mpeg4 code
parent
d6399cf3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
142 additions
and
140 deletions
+142
-140
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+142
-140
No files found.
modules/mux/mpeg/ts.c
View file @
73f01617
...
...
@@ -2084,76 +2084,9 @@ static uint32_t GetDescriptorLength24b( int i_length )
return
(
0x808000
|
(
i_l3
<<
16
)
|
(
i_l2
<<
8
)
|
i_l1
);
}
static
void
GetPMT
(
sout_mux_t
*
p_mux
,
sout_buffer_chain_t
*
c
)
static
void
GetPMT
mpeg4
(
sout_mux_t
*
p_mux
)
{
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
if
(
p_sys
->
dvbpmt
==
NULL
)
{
p_sys
->
dvbpmt
=
malloc
(
p_sys
->
i_num_pmt
*
sizeof
(
dvbpsi_pmt_t
)
);
if
(
!
p_sys
->
dvbpmt
)
{
return
;
}
}
dvbpsi_sdt_t
sdt
;
if
(
p_sys
->
b_sdt
)
dvbpsi_InitSDT
(
&
sdt
,
p_sys
->
i_tsid
,
1
,
1
,
p_sys
->
i_netid
);
for
(
int
i
=
0
;
i
<
p_sys
->
i_num_pmt
;
i
++
)
{
dvbpsi_InitPMT
(
&
p_sys
->
dvbpmt
[
i
],
p_sys
->
i_pmt_program_number
[
i
],
/* program number */
p_sys
->
i_pmt_version_number
,
1
,
/* b_current_next */
p_sys
->
i_pcr_pid
);
if
(
p_sys
->
b_sdt
)
{
dvbpsi_sdt_service_t
*
p_service
=
dvbpsi_SDTAddService
(
&
sdt
,
p_sys
->
i_pmt_program_number
[
i
],
/* service id */
0
,
/* eit schedule */
0
,
/* eit present */
4
,
/* running status ("4=RUNNING") */
0
);
/* free ca */
#define psz_sdtprov p_sys->sdt_descriptors[i].psz_provider
#define psz_sdtserv p_sys->sdt_descriptors[i].psz_service_name
/* FIXME: Ineffecient malloc's & ugly code...... */
if
(
(
psz_sdtprov
!=
NULL
)
&&
(
psz_sdtserv
!=
NULL
)
)
{
uint8_t
*
psz_sdt_desc
=
malloc
(
3
+
strlen
(
psz_sdtprov
)
+
strlen
(
psz_sdtserv
)
);
if
(
psz_sdt_desc
)
{
psz_sdt_desc
[
0
]
=
0x01
;
/* digital television service */
/* service provider name length */
psz_sdt_desc
[
1
]
=
(
char
)
strlen
(
psz_sdtprov
);
memcpy
(
&
psz_sdt_desc
[
2
],
psz_sdtprov
,
strlen
(
psz_sdtprov
)
);
/* service name length */
psz_sdt_desc
[
2
+
strlen
(
psz_sdtprov
)
]
=
(
char
)
strlen
(
psz_sdtserv
);
memcpy
(
&
psz_sdt_desc
[
3
+
strlen
(
psz_sdtprov
)],
psz_sdtserv
,
strlen
(
psz_sdtserv
)
);
dvbpsi_SDTServiceAddDescriptor
(
p_service
,
0x48
,
3
+
strlen
(
psz_sdtprov
)
+
strlen
(
psz_sdtserv
),
(
uint8_t
*
)
psz_sdt_desc
);
free
(
psz_sdt_desc
);
psz_sdt_desc
=
NULL
;
}
}
#undef psz_sdtprov
#undef psz_sdtserv
}
}
if
(
p_sys
->
i_mpeg4_streams
>
0
)
{
uint8_t
iod
[
4096
];
bits_buffer_t
bits
;
bits_buffer_t
bits_fix_IOD
;
...
...
@@ -2289,8 +2222,77 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c )
dvbpsi_PMTAddDescriptor
(
&
p_sys
->
dvbpmt
[
0
],
0x1d
,
bits
.
i_data
,
bits
.
p_data
);
}
static
void
GetPMT
(
sout_mux_t
*
p_mux
,
sout_buffer_chain_t
*
c
)
{
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
if
(
p_sys
->
dvbpmt
==
NULL
)
{
p_sys
->
dvbpmt
=
malloc
(
p_sys
->
i_num_pmt
*
sizeof
(
dvbpsi_pmt_t
)
);
if
(
p_sys
->
dvbpmt
==
NULL
)
return
;
}
dvbpsi_sdt_t
sdt
;
if
(
p_sys
->
b_sdt
)
dvbpsi_InitSDT
(
&
sdt
,
p_sys
->
i_tsid
,
1
,
1
,
p_sys
->
i_netid
);
for
(
int
i
=
0
;
i
<
p_sys
->
i_num_pmt
;
i
++
)
{
dvbpsi_InitPMT
(
&
p_sys
->
dvbpmt
[
i
],
p_sys
->
i_pmt_program_number
[
i
],
/* program number */
p_sys
->
i_pmt_version_number
,
1
,
/* b_current_next */
p_sys
->
i_pcr_pid
);
if
(
p_sys
->
b_sdt
)
{
dvbpsi_sdt_service_t
*
p_service
=
dvbpsi_SDTAddService
(
&
sdt
,
p_sys
->
i_pmt_program_number
[
i
],
/* service id */
0
,
/* eit schedule */
0
,
/* eit present */
4
,
/* running status ("4=RUNNING") */
0
);
/* free ca */
#define psz_sdtprov p_sys->sdt_descriptors[i].psz_provider
#define psz_sdtserv p_sys->sdt_descriptors[i].psz_service_name
/* FIXME: Ineffecient malloc's & ugly code...... */
if
(
(
psz_sdtprov
!=
NULL
)
&&
(
psz_sdtserv
!=
NULL
)
)
{
uint8_t
*
psz_sdt_desc
=
malloc
(
3
+
strlen
(
psz_sdtprov
)
+
strlen
(
psz_sdtserv
)
);
if
(
psz_sdt_desc
)
{
psz_sdt_desc
[
0
]
=
0x01
;
/* digital television service */
/* service provider name length */
psz_sdt_desc
[
1
]
=
(
char
)
strlen
(
psz_sdtprov
);
memcpy
(
&
psz_sdt_desc
[
2
],
psz_sdtprov
,
strlen
(
psz_sdtprov
)
);
/* service name length */
psz_sdt_desc
[
2
+
strlen
(
psz_sdtprov
)
]
=
(
char
)
strlen
(
psz_sdtserv
);
memcpy
(
&
psz_sdt_desc
[
3
+
strlen
(
psz_sdtprov
)],
psz_sdtserv
,
strlen
(
psz_sdtserv
)
);
dvbpsi_SDTServiceAddDescriptor
(
p_service
,
0x48
,
3
+
strlen
(
psz_sdtprov
)
+
strlen
(
psz_sdtserv
),
(
uint8_t
*
)
psz_sdt_desc
);
free
(
psz_sdt_desc
);
psz_sdt_desc
=
NULL
;
}
}
#undef psz_sdtprov
#undef psz_sdtserv
}
}
if
(
p_sys
->
i_mpeg4_streams
>
0
)
GetPMTmpeg4
(
p_mux
);
for
(
int
i_stream
=
0
;
i_stream
<
p_mux
->
i_nb_inputs
;
i_stream
++
)
{
ts_stream_t
*
p_stream
=
(
ts_stream_t
*
)
p_mux
->
pp_inputs
[
i_stream
]
->
p_sys
;
...
...
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