[dvblast-devel] HEVC and Dolby E support

Georgi Chorbadzhiyski gf at unixsol.org
Fri Jun 27 12:34:47 CEST 2014


Around 06/26/2014 03:27 PM, Dan Lita scribbled:
> I would like to propose a patch for bitstream and dvblast for supporting 
> hevc and Dolby E streams.
> hevc (in eutelsat transmissions) identifies as stream type 0x24.
> Dolby E is identified as streamtype 0x06 and tag 0x05
> Since I'm not a programmer please add my patches if they are okay with you:
> 
> bitstream patch:
> 
> diff --git a/bitstream/mpeg/psi/pmt.h b/bitstream/mpeg/psi/pmt.h
> index 52f188d..eb7535e 100644
> --- a/bitstream/mpeg/psi/pmt.h
> +++ b/bitstream/mpeg/psi/pmt.h
> @@ -64,6 +64,7 @@ extern "C"
>   #define PMT_STREAMTYPE_VIDEO_MPEG4  0x10
>   #define PMT_STREAMTYPE_AUDIO_LATM   0x11
>   #define PMT_STREAMTYPE_VIDEO_AVC    0x1b
> +#define PMT_STREAMTYPE_VIDEO_HEVC   0x24
> 
>   static inline void pmt_init(uint8_t *p_pmt)
>   {
> @@ -159,6 +160,7 @@ static inline const char 
> *pmt_get_streamtype_txt(uint8_t i_stream_type) {
>           case 0x19: return "Metadata in 13818-6 Synchronized Download 
> Protocol";
>           case 0x1A: return "13818-11 MPEG-2 IPMP stream";
>           case 0x1B: return "H.264/14496-10 video (MPEG-4/AVC)";
> +        case 0x24: return "HEVC video";
>           case 0x42: return "AVS Video";
>           case 0x7F: return "IPMP stream";
>           default  : return "Unknown";

It's not that simple. See http://itscj.ipsj.or.jp/sc29/open/29view/29n14227t.doc

> dvblast patch:
> diff --git a/dvblast/demux.c b/dvblast/demux.c
> index 2479617..defbbe3 100644
> --- a/dvblast/demux.c
> +++ b/dvblast/demux.c
> @@ -170,6 +170,7 @@ uint16_t map_es_pid(output_t * p_output, uint8_t 
> *p_es, uint16_t i_pid)
>           case 0x02: /* video */
>           case 0x10: /* video MPEG-4 */
>           case 0x1b: /* video H264 */
> +        case 0x24: /* video HEVC */

I think the attached dvblast patch are what you are looking for. I haven't
tested it but it looks like it'll do the job.

-- 
Georgi Chorbadzhiyski | http://georgi.unixsol.org/ | http://github.com/gfto/

-------------- next part --------------
diff --git a/mpeg/psi/pmt.h b/mpeg/psi/pmt.h
index 52f188d..193001d 100644
--- a/mpeg/psi/pmt.h
+++ b/mpeg/psi/pmt.h
@@ -159,6 +159,12 @@ static inline const char *pmt_get_streamtype_txt(uint8_t i_stream_type) {
         case 0x19: return "Metadata in 13818-6 Synchronized Download Protocol";
         case 0x1A: return "13818-11 MPEG-2 IPMP stream";
         case 0x1B: return "H.264/14496-10 video (MPEG-4/AVC)";
+        case 0x24:
+        case 0x25:
+        case 0x27:
+        case 0x28:
+        case 0x29:
+        case 0x2a: return "HEVC video";
         case 0x42: return "AVS Video";
         case 0x7F: return "IPMP stream";
         default  : return "Unknown";
-------------- next part --------------
diff --git a/demux.c b/demux.c
index 2479617..44e6bc8 100644
--- a/demux.c
+++ b/demux.c
@@ -170,6 +170,13 @@ uint16_t map_es_pid(output_t * p_output, uint8_t *p_es, uint16_t i_pid)
         case 0x02: /* video */
         case 0x10: /* video MPEG-4 */
         case 0x1b: /* video H264 */
+        case 0x24:
+        case 0x25:
+        case 0x27:
+        case 0x28:
+        case 0x29:
+        case 0x2a: /* HEVC video */
+        case 0x42: /* AVS Video */
             if ( b_do_remap )
                 i_newpid = pi_newpids[I_VPID];
             else
@@ -186,6 +193,26 @@ uint16_t map_es_pid(output_t * p_output, uint8_t *p_es, uint16_t i_pid)
                 /* Get the descriptor tag */
                 uint8_t i_tag = desc_get_tag( p_desc );
                 j++;
+
+                /* Registration descriptor */
+                if ( i_tag == 0x05 )
+                {
+                    uint32_t desc_05_identifier;
+                    const uint8_t *desc_05_ident_8;
+                    desc_05_ident_8 = desc05_get_identifier( p_desc );
+                    memcpy( &desc_05_identifier, desc_05_ident_8, 4 );
+                    switch ( desc_05_identifier )
+                    {
+                    case 0x44545331 ... 0x44545339: /* DTS1 .. DTS9 */
+                    case 0x41432d33               : /* AC-3 */
+                    case 0x42535344               : /* BSSD (LPCM), SMPTE 302M */
+                        SubStreamType = I_APID;
+                        break;
+                    case 0x56432d31               : /* VC-1 */
+                        SubStreamType = I_VPID;
+                        break;
+                    }
+                }
                 /* Check if the tag is: A/52, Enhanced A/52, DTS, AAC */
                 if (i_tag == 0x6a || i_tag == 0x7a || i_tag == 0x7b || i_tag == 0x7c)
                     SubStreamType=I_APID;
@@ -193,6 +220,14 @@ uint16_t map_es_pid(output_t * p_output, uint8_t *p_es, uint16_t i_pid)
                 if (i_tag == 0x46 || i_tag == 0x56 || i_tag == 0x59)
                     SubStreamType=I_SPUPID;
             }
+            /* Video found */
+            if (SubStreamType==I_VPID) {
+                msg_Dbg(NULL, "REMAP: PES Private Data stream identified as [Video]");
+                if ( b_do_remap )
+                    i_newpid = pi_newpids[I_VPID];
+                else
+                    i_newpid = p_output->pi_confpids[I_VPID];
+            }
             /* Audio found */
             if (SubStreamType==I_APID) {
                 msg_Dbg(NULL, "REMAP: PES Private Data stream identified as [Audio]");
@@ -1649,6 +1684,13 @@ static bool PIDWouldBeSelected( uint8_t *p_es )
     case 0x10: /* video MPEG-4 */
     case 0x11: /* audio AAC LATM */
     case 0x1b: /* video H264 */
+    case 0x24:
+    case 0x25:
+    case 0x27:
+    case 0x28:
+    case 0x29:
+    case 0x2a: /* HEVC video */
+    case 0x42: /* AVS Video */
     case 0x81: /* ATSC A/52 */
     case 0x87: /* ATSC Enhanced A/52 */
         return true;
@@ -1672,6 +1714,25 @@ static bool PIDWouldBeSelected( uint8_t *p_es )
                  || i_tag == 0x7b /* DCA */
                  || i_tag == 0x7c /* AAC */ )
                 return true;
+
+            /* Registration descriptor */
+            if ( i_tag == 0x05 )
+            {
+                uint32_t desc_05_identifier;
+                const uint8_t *desc_05_ident_8;
+                desc_05_ident_8 = desc05_get_identifier( p_desc );
+                memcpy( &desc_05_identifier, desc_05_ident_8, 4 );
+                switch ( desc_05_identifier )
+                {
+                case 0x44545331 ... 0x44545339: /* DTS1 .. DTS9 */
+                case 0x41432d33               : /* AC-3 */
+                case 0x42535344               : /* BSSD (LPCM), SMPTE 302M */
+                    return true;
+                case 0x56432d31               : /* VC-1 */
+                    return true;
+                }
+            }
+
         }
         break;
     }
@@ -1702,6 +1763,13 @@ static bool PIDCarriesPES( const uint8_t *p_es )
     case 0x10: /* video MPEG-4 */
     case 0x11: /* audio AAC LATM */
     case 0x1b: /* video H264 */
+    case 0x24:
+    case 0x25:
+    case 0x27:
+    case 0x28:
+    case 0x29:
+    case 0x2a: /* HEVC video */
+    case 0x42: /* AVS Video */
     case 0x81: /* ATSC A/52 */
     case 0x87: /* ATSC Enhanced A/52 */
         return true;
@@ -2787,6 +2855,12 @@ static const char *h222_stream_type_desc(uint8_t i_stream_type) {
         case 0x19: return "Metadata in 13818-6 Synchronized Download Protocol";
         case 0x1A: return "13818-11 MPEG-2 IPMP stream";
         case 0x1B: return "H.264/14496-10 video (MPEG-4/AVC)";
+        case 0x24:
+        case 0x25:
+        case 0x27:
+        case 0x28:
+        case 0x29:
+        case 0x2a: return "HEVC video";
         case 0x42: return "AVS Video";
         case 0x7F: return "IPMP stream";
         default  : return "Unknown stream";


More information about the dvblast-devel mailing list