diff options
author | 2020-12-12 17:19:39 +0000 | |
---|---|---|
committer | 2020-12-12 17:30:55 +0000 | |
commit | 56cfad65169740377d439b77282f9f6594f13965 (patch) | |
tree | 7a414145dac2c425c9972d092308434731135d94 /transcode.sh | |
parent | 7fa02d082905ddb1e41fe0a683bac09c2cd2c984 (diff) |
Extract transcode_compat_manifest from csv
1. Download CSV from go/transcode_compat_manifest
* File > Download > Comma-separated values
2. Source transcode_compat_manifest.sh
* $ source ./packages/providers/MediaProvider/transcode.sh
3. For device_config string
* $ ./transcode_compat_manifest -d <csv file>
4. For resource string
* $ ./transcode_compat_manifest -r <csv file>
Test: Manual
Bug: 174161238
Change-Id: I46f78ac24b0bfed6afb3b03bdbe81180b7a9638c
Diffstat (limited to 'transcode.sh')
-rw-r--r-- | transcode.sh | 17 |
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 +} |