blob: 96a586a7b2a6dc79adb8181aa0c518175005f905 [file] [log] [blame]
// Copyright 2016 The Chromium 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 "cobalt/media/base/output_device_info.h"
namespace cobalt {
namespace media {
// Output device information returned by GetOutputDeviceInfo() methods of
// various interfaces.
OutputDeviceInfo::OutputDeviceInfo()
: OutputDeviceInfo(OUTPUT_DEVICE_STATUS_ERROR_INTERNAL) {}
OutputDeviceInfo::OutputDeviceInfo(OutputDeviceStatus device_status)
: OutputDeviceInfo(std::string(), device_status,
AudioParameters::UnavailableDeviceParams()) {}
OutputDeviceInfo::OutputDeviceInfo(const std::string& device_id,
OutputDeviceStatus device_status,
const AudioParameters& output_params)
: device_id_(device_id),
device_status_(device_status),
output_params_(output_params) {}
OutputDeviceInfo::OutputDeviceInfo(const OutputDeviceInfo&) = default;
OutputDeviceInfo& OutputDeviceInfo::operator=(const OutputDeviceInfo&) =
default;
OutputDeviceInfo::~OutputDeviceInfo() {}
std::string OutputDeviceInfo::AsHumanReadableString() const {
std::ostringstream s;
s << "device_id: " << device_id() << " device_status: " << device_status()
<< " output_params: [ " << output_params().AsHumanReadableString() << " ]";
return s.str();
}
} // namespace media
} // namespace cobalt