Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: ppapi/proxy/ppapi_param_traits.cc

Issue 150403006: [PPAPI][MediaStream] Support configure for video input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/ppapi_param_traits.h" 5 #include "ppapi/proxy/ppapi_param_traits.h"
6 6
7 #include <string.h> // For memcpy 7 #include <string.h> // For memcpy
8 8
9 #include "ppapi/c/pp_resource.h" 9 #include "ppapi/c/pp_resource.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 // No default so the compiler will warn on new types. 626 // No default so the compiler will warn on new types.
627 } 627 }
628 return false; 628 return false;
629 } 629 }
630 630
631 // static 631 // static
632 void ParamTraits<ppapi::SocketOptionData>::Log(const param_type& p, 632 void ParamTraits<ppapi::SocketOptionData>::Log(const param_type& p,
633 std::string* l) { 633 std::string* l) {
634 } 634 }
635 635
636 // ppapi::MediaStreamVideoTrack::Attributes ------------------------------------
637
638 // static
639 void ParamTraits<ppapi::MediaStreamVideoTrackShared::Attributes>::Write(
640 Message* m,
641 const param_type& p) {
642 ParamTraits<uint32_t>::Write(m, p.mask);
643 ParamTraits<int32_t>::Write(m, p.buffers);
644 ParamTraits<int32_t>::Write(m, p.width);
645 ParamTraits<int32_t>::Write(m, p.height);
646 ParamTraits<int32_t>::Write(m, static_cast<int32_t>(p.format));
647 }
648
649 // static
650 bool ParamTraits<ppapi::MediaStreamVideoTrackShared::Attributes>::Read(
651 const Message* m,
652 PickleIterator* iter,
653 param_type* r) {
654 if (!ParamTraits<uint32_t>::Read(m, iter, &(r->mask)))
655 return false;
656 if (!ParamTraits<int32_t>::Read(m, iter, &(r->buffers)))
657 return false;
658 if (!ParamTraits<int32_t>::Read(m, iter, &(r->width)))
659 return false;
660 if (!ParamTraits<int32_t>::Read(m, iter, &(r->height)))
661 return false;
662 int32_t value = 0;
663 if (!ParamTraits<int32_t>::Read(m, iter, &value))
664 return false;
665 r->format = static_cast<PP_VideoFrame_Format>(value);
yzshen1 2014/02/13 19:23:26 This is not safe, you might get an invalid value i
Peng 2014/02/13 21:28:34 Done.
666 return true;
667 }
668
669 // static
670 void ParamTraits<ppapi::MediaStreamVideoTrackShared::Attributes>::Log(
671 const param_type& p,
672 std::string* l) {
673 }
636 } // namespace IPC 674 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698