/work/obj-fuzz/dist/include/mozilla/dom/MediaIPCUtils.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef mozilla_dom_media_MediaIPCUtils_h |
8 | | #define mozilla_dom_media_MediaIPCUtils_h |
9 | | |
10 | | #include "ipc/IPCMessageUtils.h" |
11 | | #include "mozilla/gfx/Rect.h" |
12 | | #include "mozilla/GfxMessageUtils.h" |
13 | | #include "PlatformDecoderModule.h" |
14 | | |
15 | | namespace IPC { |
16 | | template<> |
17 | | struct ParamTraits<mozilla::VideoInfo> |
18 | | { |
19 | | typedef mozilla::VideoInfo paramType; |
20 | | |
21 | | static void Write(Message* aMsg, const paramType& aParam) |
22 | 0 | { |
23 | 0 | // TrackInfo |
24 | 0 | WriteParam(aMsg, aParam.mMimeType); |
25 | 0 |
|
26 | 0 | // VideoInfo |
27 | 0 | WriteParam(aMsg, aParam.mDisplay); |
28 | 0 | WriteParam(aMsg, aParam.mStereoMode); |
29 | 0 | WriteParam(aMsg, aParam.mImage); |
30 | 0 | WriteParam(aMsg, aParam.ImageRect()); |
31 | 0 | } |
32 | | |
33 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
34 | 0 | { |
35 | 0 | mozilla::gfx::IntRect imageRect; |
36 | 0 | if (ReadParam(aMsg, aIter, &aResult->mMimeType) && |
37 | 0 | ReadParam(aMsg, aIter, &aResult->mDisplay) && |
38 | 0 | ReadParam(aMsg, aIter, &aResult->mStereoMode) && |
39 | 0 | ReadParam(aMsg, aIter, &aResult->mImage) && |
40 | 0 | ReadParam(aMsg, aIter, &imageRect)) { |
41 | 0 | aResult->SetImageRect(imageRect); |
42 | 0 | return true; |
43 | 0 | } |
44 | 0 | return false; |
45 | 0 | } |
46 | | }; |
47 | | } // namespace IPC |
48 | | |
49 | | #endif // mozilla_dom_media_MediaIPCUtils_h |