| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "codec_adapter_vaapi_decoder.h" |
| #include "codec_adapter_vaapi_encoder.h" |
| #include "codec_runner_app.h" |
| #include "vaapi_utils.h" |
| |
| int main(int argc, char* argv[]) { |
| ZX_DEBUG_ASSERT(argc == 1); |
| |
| constexpr uint64_t kIntelVendorId = 0x8086; |
| |
| if (!VADisplayWrapper::InitializeSingleton(kIntelVendorId)) { |
| fprintf(stderr, "Failed to initialize VADisplay\n"); |
| return -1; |
| } |
| |
| { |
| CodecRunnerApp<CodecAdapterVaApiDecoder, CodecAdapterVaApiEncoder> codec_runner; |
| codec_runner.Init(); |
| codec_runner.Serve(); |
| codec_runner.Run(); |
| } // ~codec_runner |
| |
| if (!VADisplayWrapper::DestroySingleton()) { |
| fprintf(stderr, "Failed to terminate VADisplay\n"); |
| return -1; |
| } |
| |
| return 0; |
| } |