Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
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
libdvbpsi
Commits
631af38f
Commit
631af38f
authored
Nov 02, 2016
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dr_65: DVB Scrambling descriptor
parent
1911ee61
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
224 additions
and
0 deletions
+224
-0
NEWS
NEWS
+1
-0
misc/dr.xml
misc/dr.xml
+4
-0
misc/test_dr.c
misc/test_dr.c
+22
-0
src/Makefile.am
src/Makefile.am
+2
-0
src/descriptors/dr.h
src/descriptors/dr.h
+1
-0
src/descriptors/dvb/dr_65.c
src/descriptors/dvb/dr_65.c
+96
-0
src/descriptors/dvb/dr_65.h
src/descriptors/dvb/dr_65.h
+98
-0
No files found.
NEWS
View file @
631af38f
...
...
@@ -16,6 +16,7 @@ Changes between 1.3.0 and 2.0.0-git:
- 0x20 MPEG External_ES_ID descriptor
- 0x23 MPEG MultiplexBuffer descriptor
- 0x24 Content labelling descriptor
- 0x65 Scrambling descriptor
- 0x67 DVB Transport Stream descriptor
* Fix bugs in descriptors: 0x41, 0x44, 0x4a, 0x4b, 0x53, 0x54, 0x55, 0x56, 0x59, 0xa0
* Fix bugs in table: CA, EIT, NIT
...
...
misc/dr.xml
View file @
631af38f
...
...
@@ -386,6 +386,10 @@
<integer
name=
"i_other_frequency_flag"
bitcount=
"1"
default=
"0"
/>
</descriptor>
<descriptor
name=
"scrambling"
sname=
"dvb_scrambling"
>
<integer
name=
"i_scrambling_mode"
bitcount=
"8"
default=
"1"
/>
</descriptor>
<descriptor
name=
"transport stream"
sname=
"dvb_transport_stream"
>
<insert>
<begin>
...
...
misc/test_dr.c
View file @
631af38f
...
...
@@ -2623,6 +2623,27 @@ static int main_dvb_terr_deliv_sys_0(void)
return
i_err
;
}
/* scrambling */
static
int
main_dvb_scrambling_0
(
void
)
{
BOZO_VARS
(
dvb_scrambling
);
BOZO_START
(
scrambling
);
/* check i_scrambling_mode */
BOZO_init_integer
(
i_scrambling_mode
,
1
);
BOZO_begin_integer
(
i_scrambling_mode
,
8
)
BOZO_DOJOB
(
dvb_scrambling
);
BOZO_check_integer
(
i_scrambling_mode
,
8
)
BOZO_CLEAN
();
BOZO_end_integer
(
i_scrambling_mode
,
8
)
BOZO_END
(
scrambling
);
return
i_err
;
}
/* transport stream */
static
int
main_dvb_transport_stream_0
(
void
)
{
...
...
@@ -2697,6 +2718,7 @@ int main(void)
i_err
|=
main_dvb_local_time_offset_0
();
i_err
|=
main_dvb_subtitling_0
();
i_err
|=
main_dvb_terr_deliv_sys_0
();
i_err
|=
main_dvb_scrambling_0
();
i_err
|=
main_dvb_transport_stream_0
();
if
(
i_err
)
...
...
src/Makefile.am
View file @
631af38f
...
...
@@ -80,6 +80,7 @@ dvbdrinclude_HEADERS = descriptors/dvb/dr_40.h \
descriptors/dvb/dr_59.h
\
descriptors/dvb/dr_5a.h
\
descriptors/dvb/dr_62.h
\
descriptors/dvb/dr_65.h
\
descriptors/dvb/dr_66.h
\
descriptors/dvb/dr_67.h
\
descriptors/dvb/dr_69.h
\
...
...
@@ -155,6 +156,7 @@ descriptors_src = descriptors/mpeg/dr_02.c \
descriptors/dvb/dr_59.c
\
descriptors/dvb/dr_5a.c
\
descriptors/dvb/dr_62.c
\
descriptors/dvb/dr_65.c
\
descriptors/dvb/dr_66.c
\
descriptors/dvb/dr_67.c
\
descriptors/dvb/dr_69.c
\
...
...
src/descriptors/dr.h
View file @
631af38f
...
...
@@ -62,6 +62,7 @@
#include "dvb/dr_59.h"
#include "dvb/dr_5a.h"
#include "dvb/dr_62.h"
#include "dvb/dr_65.h"
#include "dvb/dr_66.h"
#include "dvb/dr_67.h"
#include "dvb/dr_69.h"
...
...
src/descriptors/dvb/dr_65.c
0 → 100644
View file @
631af38f
/*****************************************************************************
* dr_65.c
* Copyright (C) 2016 VideoLAN
* $Id$
*
* Authors: Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#if defined(HAVE_INTTYPES_H)
#include <inttypes.h>
#elif defined(HAVE_STDINT_H)
#include <stdint.h>
#endif
#include "../../dvbpsi.h"
#include "../../dvbpsi_private.h"
#include "../../descriptor.h"
#include "dr_65.h"
/*****************************************************************************
* dvbpsi_decode_dvb_scrambling_dr
*****************************************************************************/
dvbpsi_dvb_scrambling_dr_t
*
dvbpsi_decode_dvb_scrambling_dr
(
dvbpsi_descriptor_t
*
p_descriptor
)
{
dvbpsi_dvb_scrambling_dr_t
*
p_decoded
;
/* Check the tag */
if
(
!
dvbpsi_CanDecodeAsDescriptor
(
p_descriptor
,
0x65
))
return
NULL
;
/* Don't decode twice */
if
(
dvbpsi_IsDescriptorDecoded
(
p_descriptor
))
return
p_descriptor
->
p_decoded
;
/* Check the length */
if
(
p_descriptor
->
i_length
!=
0x01
)
return
NULL
;
p_decoded
=
(
dvbpsi_dvb_scrambling_dr_t
*
)
calloc
(
1
,
sizeof
(
dvbpsi_dvb_scrambling_dr_t
));
if
(
!
p_decoded
)
return
NULL
;
p_decoded
->
i_scrambling_mode
=
p_descriptor
->
p_data
[
0
];
p_descriptor
->
p_decoded
=
(
void
*
)
p_decoded
;
return
p_decoded
;
}
/*****************************************************************************
* dvbpsi_gen_dvb_scrambling_dr
*****************************************************************************/
dvbpsi_descriptor_t
*
dvbpsi_gen_dvb_scrambling_dr
(
dvbpsi_dvb_scrambling_dr_t
*
p_decoded
,
bool
b_duplicate
)
{
/* Create the descriptor */
dvbpsi_descriptor_t
*
p_descriptor
=
dvbpsi_NewDescriptor
(
0x65
,
1
,
NULL
);
if
(
!
p_descriptor
)
return
NULL
;
/* Encode data */
p_descriptor
->
p_data
[
0
]
=
p_decoded
->
i_scrambling_mode
;
if
(
b_duplicate
)
{
/* Duplicate decoded data */
p_descriptor
->
p_decoded
=
dvbpsi_DuplicateDecodedDescriptor
(
p_decoded
,
sizeof
(
dvbpsi_dvb_scrambling_dr_t
));
}
return
p_descriptor
;
}
src/descriptors/dvb/dr_65.h
0 → 100644
View file @
631af38f
/*****************************************************************************
* dr_65.h
* Copyright (C) 2016 VideoLAN
* $Id$
*
* Authors: Jean-Paul Saman <jpsaman@videolan.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
/*!
* \file dr_65.h
* \author Jean-Paul Saman
* \brief Scrambling descriptor
*/
#ifndef _DR_65_H
#define _DR_66_H
/*****************************************************************************
* dvbpsi_dvb_scrambling_dr_s
*****************************************************************************/
/*!
* \struct dvbpsi_dvb_scrambling_dr_s
* \brief Scrambling Descriptor
*
* This structure is used to store a decoded Scrambling descriptor.
*
* The meaning of i_scrambling_mode is according ETSI EN 300 468 V1.13.1 (2012-04)
*
* scrambling_mode Description
* =============== ==========================================================
* 0x00 Reserved for future use
* 0x01 This value indicates use of DVB-CSA1.
* It is the default mode and shall be used
* when the scrambling descriptor is not present
* in the program map section
* 0x02 This value indicates use of DVB-CSA2
* 0x03 This value indicates use of DVB-CSA3 in standard mode
* 0x04 This value indicates use of DVB-CSA3 in minimally enhanced mode
* 0x05 This value indicates use of DVB-CSA3 in fully enhanced mode
* 0x06 to 0x6F Reserved for future use
* 0x70 to 0x7F ATIS defined (ATIS-0800006, see annex J)
* 0x80 to 0xFE User defined
* 0xFF Reserved for future use
*/
/*!
* \typedef struct dvbpsi_dvb_scrambling_dr_s dvbpsi_dvb_scrambling_dr_t
* \brief dvbpsi_dvb_scrambling_dr_t type definition.
*/
typedef
struct
dvbpsi_dvb_scrambling_dr_s
{
uint8_t
i_scrambling_mode
;
/*!< Scrambling mode */
}
dvbpsi_dvb_scrambling_dr_t
;
/*****************************************************************************
* dvbpsi_dvb_scrambling_dr_s
*****************************************************************************/
/*!
* \fn dvbpsi_dvb_scrambling_dr_t *dvbpsi_decode_dvb_scrambling_dr(
* dvbpsi_descriptor_t *p_descriptor)
* \brief Decode a Scrambling descriptor (tag 0x65)
* \param p_descriptor Raw descriptor to decode.
* \return NULL if the descriptor could not be decoded or a pointer to a
* dvbpsi_dvb_scrambling_dr_t structure.
*/
dvbpsi_dvb_scrambling_dr_t
*
dvbpsi_decode_dvb_scrambling_dr
(
dvbpsi_descriptor_t
*
p_descriptor
);
/*****************************************************************************
* dvbpsi_gen_scrambling_dr
*****************************************************************************/
/*!
* \fn dvbpsi_descriptor_t *dvbpsi_gen_scrambling_dr(dvbpsi_dvb_scrambling_dr_t *p_decoded,
bool b_duplicate);
* \brief Scrambling descriptor generator.
* \param p_decoded pointer to a decoded Scrambling descriptor structure
* \param b_duplicate if true then duplicate the p_decoded structure into
* the descriptor
* \return a pointer to a new descriptor structure which contains encoded data.
*/
dvbpsi_descriptor_t
*
dvbpsi_gen_dvb_scrambling_dr
(
dvbpsi_dvb_scrambling_dr_t
*
p_decoded
,
bool
b_duplicate
);
#endif
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