| Index: ppapi/cpp/private/video_destination_private.cc
|
| diff --git a/ppapi/cpp/video_writer.cc b/ppapi/cpp/private/video_destination_private.cc
|
| similarity index 30%
|
| rename from ppapi/cpp/video_writer.cc
|
| rename to ppapi/cpp/private/video_destination_private.cc
|
| index 372bfad3121ce8615559a285993273ebb07cfcd4..a8d1b16e8a6ca0dd417adffe68c7633a1b339853 100644
|
| --- a/ppapi/cpp/video_writer.cc
|
| +++ b/ppapi/cpp/private/video_destination_private.cc
|
| @@ -2,69 +2,74 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ppapi/cpp/video_writer.h"
|
| +#include "ppapi/cpp/private/video_destination_private.h"
|
|
|
| #include "ppapi/c/pp_errors.h"
|
| -#include "ppapi/c/ppb_video_writer.h"
|
| +#include "ppapi/c/private/ppb_video_destination_private.h"
|
| #include "ppapi/cpp/instance_handle.h"
|
| #include "ppapi/cpp/module.h"
|
| #include "ppapi/cpp/module_impl.h"
|
| +#include "ppapi/cpp/private/video_frame_private.h"
|
| #include "ppapi/cpp/var.h"
|
| -#include "ppapi/cpp/video_frame.h"
|
|
|
| namespace pp {
|
|
|
| namespace {
|
|
|
| -template <> const char* interface_name<PPB_VideoWriter_0_1>() {
|
| - return PPB_VIDEOWRITER_INTERFACE_0_1;
|
| +template <> const char* interface_name<PPB_VideoDestination_Private_0_1>() {
|
| + return PPB_VIDEODESTINATION_PRIVATE_INTERFACE_0_1;
|
| }
|
|
|
| } // namespace
|
|
|
| -// VideoWriter -----------------------------------------------------------------
|
| -
|
| -VideoWriter::VideoWriter() {
|
| +VideoDestination_Private::VideoDestination_Private() {
|
| }
|
|
|
| -VideoWriter::VideoWriter(const InstanceHandle& instance) {
|
| - if (!has_interface<PPB_VideoWriter_0_1>())
|
| +VideoDestination_Private::VideoDestination_Private(
|
| + const InstanceHandle& instance) {
|
| + if (!has_interface<PPB_VideoDestination_Private_0_1>())
|
| return;
|
| - PassRefFromConstructor(get_interface<PPB_VideoWriter_0_1>()->Create(
|
| - instance.pp_instance()));
|
| + PassRefFromConstructor(
|
| + get_interface<PPB_VideoDestination_Private_0_1>()->Create(
|
| + instance.pp_instance()));
|
| }
|
|
|
| -VideoWriter::VideoWriter(const VideoWriter& other)
|
| +VideoDestination_Private::VideoDestination_Private(
|
| + const VideoDestination_Private& other)
|
| : Resource(other) {
|
| }
|
|
|
| -VideoWriter::VideoWriter(PassRef, PP_Resource resource)
|
| +VideoDestination_Private::VideoDestination_Private(PassRef,
|
| + PP_Resource resource)
|
| : Resource(PASS_REF, resource) {
|
| }
|
|
|
| -int32_t VideoWriter::Open(const CompletionCallbackWithOutput<Var>& cc) {
|
| - if (has_interface<PPB_VideoWriter_0_1>()) {
|
| +int32_t VideoDestination_Private::Open(const Var& stream_url,
|
| + const CompletionCallback& cc) {
|
| + if (has_interface<PPB_VideoDestination_Private_0_1>()) {
|
| int32_t result =
|
| - get_interface<PPB_VideoWriter_0_1>()->Open(
|
| + get_interface<PPB_VideoDestination_Private_0_1>()->Open(
|
| pp_resource(),
|
| - cc.output(), cc.pp_completion_callback());
|
| + stream_url.pp_var(),
|
| + cc.pp_completion_callback());
|
| return result;
|
| }
|
| return cc.MayForce(PP_ERROR_NOINTERFACE);
|
| }
|
|
|
| -int32_t VideoWriter::PutFrame(const VideoFrame& frame) {
|
| - if (has_interface<PPB_VideoWriter_0_1>()) {
|
| - return get_interface<PPB_VideoWriter_0_1>()->PutFrame(
|
| +int32_t VideoDestination_Private::ReceiveFrame(
|
| + const VideoFrame_Private& frame) {
|
| + if (has_interface<PPB_VideoDestination_Private_0_1>()) {
|
| + return get_interface<PPB_VideoDestination_Private_0_1>()->ReceiveFrame(
|
| pp_resource(),
|
| &frame.pp_video_frame());
|
| }
|
| return PP_ERROR_NOINTERFACE;
|
| }
|
|
|
| -void VideoWriter::Close() {
|
| - if (has_interface<PPB_VideoWriter_0_1>()) {
|
| - get_interface<PPB_VideoWriter_0_1>()->Close(pp_resource());
|
| +void VideoDestination_Private::Close() {
|
| + if (has_interface<PPB_VideoDestination_Private_0_1>()) {
|
| + get_interface<PPB_VideoDestination_Private_0_1>()->Close(pp_resource());
|
| }
|
| }
|
|
|
|
|