amlqtdmx: CB1 add enc byte range in cbcs scene [1/1]

PD#SWPL-186273

Problem:
add enc byte range in cbcs scene

Solution:
add enc byte range in cbcs scene

Verify:
(detail info)

Change-Id: If8a188633173088216d9164f314114104f29af40
Signed-off-by: xuesong.jiang <xuesong.jiang@amlogic.com>
diff --git a/aml-qtdemux/aml-qtdemux.c b/aml-qtdemux/aml-qtdemux.c
index 63ea09b..85ab95d 100644
--- a/aml-qtdemux/aml-qtdemux.c
+++ b/aml-qtdemux/aml-qtdemux.c
@@ -2748,7 +2748,7 @@
   GST_DEBUG_OBJECT (qtdemux, "default sample properties: "
       "is_encrypted=%u, iv_size=%u constant_iv_size=%u", is_encrypted, iv_size, constant_iv_size);
   gst_buffer_unref (kid_buf);
-  if (protection_scheme_type == AML_FOURCC_cbcs) {
+  if (protection_scheme_type == AML_FOURCC_cbcs || protection_scheme_type == AML_FOURCC_cens) {
     if (crypt_byte_block != 0 || skip_byte_block != 0) {
       gst_structure_set (info->default_properties, "crypt_byte_block",
           G_TYPE_UINT, crypt_byte_block, "skip_byte_block", G_TYPE_UINT,
@@ -3929,7 +3929,7 @@
       buf = gst_buffer_new_wrapped (data, iv_size);
       gst_structure_set (properties, "iv", GST_TYPE_BUFFER, buf, NULL);
       gst_buffer_unref (buf);
-    } else if (stream->protection_scheme_type == AML_FOURCC_cbcs) {
+    } else if (stream->protection_scheme_type == AML_FOURCC_cbcs || stream->protection_scheme_type == AML_FOURCC_cens) {
       const GValue *constant_iv_size_value =
           gst_structure_get_value (properties, "constant_iv_size");
       const GValue *constant_iv_value =
@@ -6064,7 +6064,7 @@
 
     if (info->crypto_info == NULL) {
       /* cbc1 audio may has no saiz node, need update crypto info from default properties */
-      if (stream->protection_scheme_type == AML_FOURCC_cbcs) {
+      if (stream->protection_scheme_type == AML_FOURCC_cbcs || stream->protection_scheme_type == AML_FOURCC_cens) {
         guint crypt_byte_block = 0;
         guint skip_byte_block = 0;
         guint iv_size = 0;
@@ -6117,7 +6117,7 @@
         GST_LOG_OBJECT (qtdemux, "attaching cenc metadata [%u/%u]", index,
             info->crypto_info->len);
 
-        if (stream->protection_scheme_type == AML_FOURCC_cbcs) {
+        if (stream->protection_scheme_type == AML_FOURCC_cbcs || stream->protection_scheme_type == AML_FOURCC_cens) {
           guint subsample_count = 0;
           GstBuffer *subsamples = NULL;
           guint crypt_byte_block = 0;
@@ -10957,7 +10957,7 @@
     is_encrypted = AML_QT_UINT8 (tenc_data + 2);
     iv_size = AML_QT_UINT8 (tenc_data + 3);
     default_kid = (tenc_data + 4);
-    if (stream->protection_scheme_type == AML_FOURCC_cbcs) {
+    if (stream->protection_scheme_type == AML_FOURCC_cbcs || stream->protection_scheme_type == AML_FOURCC_cens) {
       guint8 possible_pattern_info;
       if (iv_size == 0) {
         constant_iv_size = AML_QT_UINT8 (tenc_data + 20);