summary refs log tree commit diff
path: root/devices/src/virtio/video/encoder/mod.rs
blob: d6b8cef1e868a4b308902ee0a7632959ce1ad1e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

//! Implementation of the the `Encoder` struct, which is responsible for translation between the
//! virtio protocols and LibVDA APIs.

use sys_util::PollContext;

use crate::virtio::resource_bridge::ResourceRequestSocket;
use crate::virtio::video::command::VideoCmd;
use crate::virtio::video::device::{Device, Token, VideoCmdResponseType, VideoEvtResponseType};
use crate::virtio::video::error::*;

pub struct Encoder;

impl Encoder {
    pub fn new() -> Self {
        Encoder {}
    }
}

impl Device for Encoder {
    fn process_cmd(
        &mut self,
        _cmd: VideoCmd,
        _poll_ctx: &PollContext<Token>,
        _resource_bridge: &ResourceRequestSocket,
    ) -> VideoResult<VideoCmdResponseType> {
        Err(VideoError::InvalidOperation)
    }

    fn process_event_fd(&mut self, _stream_id: u32) -> Option<VideoEvtResponseType> {
        None
    }

    fn take_resource_id_to_notify_eos(&mut self, _stream_id: u32) -> Option<u32> {
        None
    }
}