Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

enum SegmentAlignment {
  ALIGNMENT_UNDEFINED = 0;
ALIGNMENT_NAL = 1;
 ALIGNMENT_AU
= 2;
}

enum CipherMode {
  CIPHER_MODE_UNDEFINED = 0;
 CIPHER_MODE_CENC     = 1; /* AES-CTR scheme */
 CIPHER_MODE_CBC1     = 2; /* AES-CBC scheme */
 CIPHER_MODE_CENS     = 3; /* AES-CTR subsample pattern encryption scheme */
 CIPHER_MODE_CBCS     = 4; /* AES-CBC subsample pattern encryption scheme */
}

message MediaSegmentMetadata {
     required optional uint32                 length               = 1;             /* Number of bytes in sample */
    optional  required sint64                 time_position        = 2;             /* Position in stream in nanoseconds */
     required optional sint64                 sample_duration      = 3;             /* Frame/sample duration in nanoseconds */
     required optional uint32                 stream_id            = 4;             /* stream id (unique ID for ES, as defined in attachSource()) */
    optional uint32                 sample_rate          = 5;             /* Samples per second for audio segments */
    optional uint32                 channels_num         = 6;             /* Number of channels for audio segments */
    optional uint32                 width                = 7;             /* Frame width in pixels for video segments */
    optional uint32                 height               = 8;             /* Frame height in pixels for video segments */
    optional SegmentAlignment       segment_alignment    = 9;             /* Segment alignment can be specified for H264/H265, will use NAL if not set */
    optional bytes                  extra_data           = 10;            /* Buffer containing extradata */
    optional bytes                  media_key_session_id = 11;            /* Buffer containing key session ID to use for decryption */
    optional bytes                  key_id               = 12;            /* Buffer containing Key ID to use for decryption */
    optional bytes                  init_vector          = 13;            /* Buffer containing the initialization vector for decryption */
    optional uint32                 init_with_last_15    = 14;            /* initWithLast15 value for decryption */
    optional repeated SubsamplePair sub_sample_info      = 15;            /* If present, use gather/scatter decryption based on this list of clear/encrypted byte lengths. */
                                                                          /* If not present and content is encrypted then entire media segment needs decryption (unless    */
                                                                          /* cipher_mode indicates pattern encryption in which case crypt/skip byte block value specify    */
                                                                          /* the encryption pattern)                                                                       */
    optional bytes                  codec_data           = 16;            /* Buffer containing updated codec data for video segments */
    optional CipherMode             cipher_mode          = 17;            /* Block cipher mode of operation when common encryption used */
    optional uint32                 crypt_byte_block     = 18;            /* Crypt byte block value for CBCS cipher mode pattern */
    optional uint32                 skip_byte_block      = 19;            /* Skip byte block value for CBCS cipher mode pattern */
optional Fraction         frame_rate           = 20;            /* Fractional frame rate of the video segments */
}

message SubsamplePair

{

    optional  required uint32_t               num_clear_bytes      = 1;             /* How many of next bytes in sequence are clear */
     required optional uint32_t               num_encrypted_bytes  = 2;             /* How many of next bytes in sequence are encrypted */

}

...