Browse Source

add DVB subtitles (very basic)

master
Christophe Massiot 11 years ago
parent
commit
c0a424f9fb
5 changed files with 95 additions and 2 deletions
  1. +2
    -2
      dvb/ci.h
  2. +6
    -0
      dvb/si/desc_46.h
  3. +6
    -0
      dvb/si/desc_56.h
  4. +80
    -0
      dvb/sub.h
  5. +1
    -0
      mpeg/psi/desc_0a.h

+ 2
- 2
dvb/ci.h View File

@ -1,5 +1,5 @@
/*****************************************************************************
* ci.h: ETSI EN 50 221 Common Interface Specification
* ci.h: CENELEC EN 50 221 Common Interface Specification
*****************************************************************************
* Copyright (C) 2010 VideoLAN
*
@ -27,7 +27,7 @@
/*
* Normative references:
* - ETSI EN 50 221 (1997) (Common Interface Specification)
* - CENELEC EN 50 221 (1997) (Common Interface Specification)
*/
#ifndef __BITSTREAM_DVB_CI_H__

+ 6
- 0
dvb/si/desc_46.h View File

@ -49,6 +49,12 @@ extern "C"
#define DESC46_HEADER_SIZE DESC_HEADER_SIZE
#define DESC46_LANGUAGE_SIZE 5
#define DESC46_TELETEXTTYPE_INITIAL 1
#define DESC46_TELETEXTTYPE_SUBTITLE 2
#define DESC46_TELETEXTTYPE_INFORMATION 3
#define DESC46_TELETEXTTYPE_SCHEDULE 4
#define DESC46_TELETEXTTYPE_SUBTITLE_H 5
static inline void desc46_init(uint8_t *p_desc)
{
desc_set_tag(p_desc, 0x46);

+ 6
- 0
dvb/si/desc_56.h View File

@ -48,6 +48,12 @@ extern "C"
#define DESC56_HEADER_SIZE DESC46_HEADER_SIZE
#define DESC56_LANGUAGE_SIZE DESC46_LANGUAGE_SIZE
#define DESC56_TELETEXTTYPE_INITIAL DESC46_TELETEXTTYPE_INITIAL
#define DESC56_TELETEXTTYPE_SUBTITLE DESC46_TELETEXTTYPE_SUBTITLE
#define DESC56_TELETEXTTYPE_INFORMATION DESC46_TELETEXTTYPE_INFORMATION
#define DESC56_TELETEXTTYPE_SCHEDULE DESC46_TELETEXTTYPE_SCHEDULE
#define DESC56_TELETEXTTYPE_SUBTITLE_H DESC46_TELETEXTTYPE_SUBTITLE_H
static inline void desc56_init(uint8_t *p_desc)
{
desc_set_tag(p_desc, 0x56);

+ 80
- 0
dvb/sub.h View File

@ -0,0 +1,80 @@
/*****************************************************************************
* sub.h: ETSI EN 300 743 Subtitling Systems
*****************************************************************************
* Copyright (C) 2014 VideoLAN
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*****************************************************************************/
/*
* Normative references:
* - ETSI EN 300 743 V1.5.1 (2014-01) (Subtitling Systems)
*/
#ifndef __BITSTREAM_DVB_SUB_H__
#define __BITSTREAM_DVB_SUB_H__
#ifdef __cplusplus
extern "C"
{
#endif
/*****************************************************************************
* PES data field
*****************************************************************************/
#define DVBSUB_HEADER_SIZE 2
#define DVBSUB_DATA_IDENTIFIER 0x20
/*****************************************************************************
* Subtitling segment
*****************************************************************************/
#define DVBSUBS_HEADER_SIZE 6
#define DVBSUBS_SYNC 0xf
#define DVBSUBS_PAGE_COMPOSITION 0x10
#define DVBSUBS_REGION_COMPOSITION 0x11
#define DVBSUBS_CLUT_DEFINITION 0x12
#define DVBSUBS_OBJECT_DATA 0x13
#define DVBSUBS_DISPLAY_DEFINITION 0x14
#define DVBSUBS_DISPARITY_SIGNALLING 0x15
#define DVBSUBS_END_OF_DISPLAY_SET 0x80
static inline uint8_t dvbsubs_get_type(const uint8_t *p_dvbsubs)
{
return p_dvbsubs[1];
}
static inline uint16_t dvbsubs_get_page(const uint8_t *p_dvbsubs)
{
return (p_dvbsubs[2] << 8) | p_dvbsubs[3];
}
static inline uint16_t dvbsubs_get_length(const uint8_t *p_dvbsubs)
{
return (p_dvbsubs[4] << 8) | p_dvbsubs[5];
}
#ifdef __cplusplus
}
#endif
#endif

+ 1
- 0
mpeg/psi/desc_0a.h View File

@ -48,6 +48,7 @@ extern "C"
#define DESC0A_HEADER_SIZE DESC_HEADER_SIZE
#define DESC0A_LANGUAGE_SIZE 4
#define DESC0A_TYPE_UNDEFINED 0x0
#define DESC0A_TYPE_CLEAN 0x1
#define DESC0A_TYPE_HEARING_IMP 0x2
#define DESC0A_TYPE_VISUAL_IMP 0x3

Loading…
Cancel
Save