tree: a5bd24b23d34fc5cf1adcecf52d967d08eff2801 [path history] [tgz]
  1. meta/
  2. test/
  3. BUILD.gn
  4. cleartvp.cc
  5. in_stream.cc
  6. in_stream.h
  7. in_stream_buffer.cc
  8. in_stream_buffer.h
  9. in_stream_file.cc
  10. in_stream_file.h
  11. in_stream_http.cc
  12. in_stream_http.h
  13. in_stream_peeker.cc
  14. in_stream_peeker.h
  15. input_copier.h
  16. main.cc
  17. README.md
  18. use_aac_decoder.cc
  19. use_aac_decoder.h
  20. use_video_decoder.cc
  21. use_video_decoder.h
  22. util.cc
  23. util.h
src/media/codec/examples/use_media_decoder/README.md

use_media_decoder

use_media_decoder is manual tool for interacting with some of the system's available codecs.

Building

Make sure that //src/media/codec/examples:use_media_decoder is part of your fx set. If it wasn't previously, restart your emulator or OTA the build to your target after adding it and building.

Using

use_media_decoder can be used from the shell. To provide input data files for the command, first determine your target's IP address.

$ fx ffx target list
NAME                      SERIAL       TYPE                   STATE      ADDRS/IP                           RCS
fuchsia-54b2-0389-6769    <unknown>    workstation_eng.x64    Product    [fe80::d919:d797:efed:d078%br0,    Y
                                                                          192.168.42.210]

Copy the file to the target using IPv4...

$ fx scp myfile.vp9 fuchsia@192.168.42.210:/tmp/myfile.vp9
test-25fps.vp9        100%   86KB  22.8MB/s   00:00

...or IPv6

$ fx scp -6 myfile.vp9 fuchsia@\[fe80::d919:d797:efed:d078%br0\]:/tmp/myfile.vp9
test-25fps.vp9        100%   86KB  22.8MB/s   00:00

Now run use_media_decoder.

$ fx shell use_media_decoder --vp9 /tmp/myfile.vp9
WaitForSysmemBuffersAllocated() done - is_output: 0 buffer_count: 2
VP9 input stream: 1 stream_frame_ordinal: 0 input_pts_counter: 0 frame_header.size_bytes: 0x29b2
WaitForSysmemBuffersAllocated() done - is_output: 1 buffer_count: 10
VP9 input stream: 1 stream_frame_ordinal: 1 input_pts_counter: 1 frame_header.size_bytes: 0x9c8
VP9 input stream: 1 stream_frame_ordinal: 2 input_pts_counter: 2 frame_header.size_bytes: 0x7b
VP9 input stream: 1 stream_frame_ordinal: 3 input_pts_counter: 3 frame_header.size_bytes: 0x6f
...

You can use fx scp in the other direction to copy off any output files your command generates.