summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--transcode.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/transcode.sh b/transcode.sh
new file mode 100644
index 000000000..b36ecccd4
--- /dev/null
+++ b/transcode.sh
@@ -0,0 +1,17 @@
+# For extracting a transcode_compat_manifest from a csv file in the format
+# package_name,hevc_support,slow_motion_support,hdr_10_support,hdr_10_plus_support,hdr_hlg_support,hdr_dolby_vision_support,hevc_support_shift,slow_motion_support_shift,hdr_10_support_shift,hd_10_plus_support_shift,hdr_hlg_support_shift,hdr_dolby_vision_support_shift,media_capability
+# com.foo,1,0,0,0,0,0,1,0,0,0,0,0,1
+# ....
+function transcode_compat_manifest() {
+ # Cat file
+ # Remove CLRF (DOS format)
+ # Remove first line (header)
+ # Extract first and last columns in each line
+ # For device_config convert new lines (\n) to comma(,)
+ # For device_config remove trailing comma(,)
+ case "$1" in
+ -r) cat $2 | tr -d '\r' | sed 1d | awk -F "," '{new_var=$1","$NF; print new_var}';;
+ -d) cat $2 | tr -d '\r' | sed 1d | awk -F "," '{new_var=$1","$NF; print new_var}' | tr '\n' ',' | sed 's/,$//g';;
+ *) "Enter '-d' for device_config, '-r' for resource";;
+ esac
+}