Skip to content
Snippets Groups Projects
Commit c159d204 authored by Jeremy Wu's avatar Jeremy Wu Committed by Gerrit Code Review
Browse files

Merge changes I6e6d6b01,I273747d5,I8f6489d6 into main

* changes:
  Floss: fix typo of Lc3Param
  Floss: define MMC DBus service proto
  Floss: define MMC interface
parents d7266a1b 715f80bb
No related branches found
No related tags found
No related merge requests found
/*
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MMC_MMC_INTERFACE_MMC_INTERFACE_H_
#define MMC_MMC_INTERFACE_MMC_INTERFACE_H_
#include <stdint.h>
#include "mmc/proto/mmc_config.pb.h"
namespace mmc {
// An abstract interface representing either an encoder or a decoder.
class MmcInterface {
public:
virtual ~MmcInterface() = default;
// Builds and configures the encoder/decoder instance.
//
// Returns:
// Input frame size accepted by the transcoder, if init succeeded.
// Negative errno on error, otherwise.
virtual int init(ConfigParam config) = 0;
// Resets the encoder/decoder instance.
virtual void cleanup() = 0;
// Transcodes data in |i_buf|, and stores the result in |o_buf|.
//
// Returns:
// Transcoded data length, if transcode succeeded.
// Negative errno on error, otherwise.
virtual int transcode(uint8_t* i_buf, int i_len, uint8_t* o_buf,
int o_len) = 0;
};
} // namespace mmc
#endif // MMC_MMC_INTERFACE_MMC_INTERFACE_H_
......@@ -24,3 +24,13 @@ proto_library("mmc_config_proto") {
]
standalone=true
}
proto_library("mmc_service_proto") {
proto_in_dir = "./"
proto_out_dir = "include/mmc/proto"
sources = [
"${proto_in_dir}/mmc_service.proto",
]
deps = [ ":mmc_config_proto" ]
standalone=true
}
......@@ -23,7 +23,7 @@ option optimize_for = LITE_RUNTIME;
// union of Lc3 config and codec parameters
message Lc3Param {
// encoder/decoder config
int32 dt_hz = 1;
int32 dt_us = 1;
int32 sr_hz = 2;
int32 sr_pcm_hz = 3;
......
/*
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package mmc;
import "mmc_config.proto";
option optimize_for = LITE_RUNTIME;
message CodecInitRequest {
// Codec-specific parameters passed by client.
ConfigParam config = 1;
}
message CodecInitResponse {
// Socket name generated by the daemon.
string socket_token = 1;
// Input frame size accepted by the codec server.
int32 input_frame_size = 2;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment