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

Side by Side Diff: src/trusted/sel_universal/multimedia.h

Issue 7046064: Some small refactoring and renaming of sel_universel pepper emulation components. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/trusted/sel_universal/build.scons ('k') | src/trusted/sel_universal/multimedia_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file.
5 */
6
7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_SEL_UNIVERASAL_MULTIMEDIA_H_
8 #define NATIVE_CLIENT_SRC_TRUSTED_SEL_UNIVERASAL_MULTIMEDIA_H_
9
10 // Abstract multimedia interface
11 // NOTE: currently only video and simple events are supported
12
13 class PP_InputEvent;
14
15 const int MY_EVENT_FLUSH_CALL_BACK = 88;
16 const int MY_EVENT_INIT_AUDIO = 89;
17 // data1 = callback_id, data2 = result value
18 const int MY_EVENT_TIMER_CALL_BACK = 90;
19
20
21
22 bool IsUserEvent(PP_InputEvent* event);
23 void MakeUserEvent(PP_InputEvent* event, int code, int data1, int data2);
24
25 bool IsInvalidEvent(PP_InputEvent* event);
26 void MakeInvalidEvent(PP_InputEvent* event);
27
28 bool IsTerminationEvent(PP_InputEvent* event);
29 void MakeTerminationEvent(PP_InputEvent* event);
30
31
32 int GetCodeFromUserEvent(PP_InputEvent* event);
33 int GetData1FromUserEvent(PP_InputEvent* event);
34 int GetData2FromUserEvent(PP_InputEvent* event);
35
36 void MakeInvalidEvent(PP_InputEvent* event);
37
38 typedef void (*AUDIO_CALLBACK)(void* data, unsigned char* buffer, int length);
39
40 class IMultimedia {
41 public:
42 virtual ~IMultimedia() {}
43
44 virtual int VideoBufferSize() = 0;
45 // Trigger a frame update in the multimedia system
46 virtual void VideoUpdate(const void* data) = 0;
47 // Inject a userevent with the two arbitrary pieces of
48 // data into the event buffer
49 virtual void PushUserEvent(int delay, int code, int data1, int data2) = 0;
50 // Get next event (non-blocking). If no event was available
51 // IsInvalidEvent(event) will be true afterwards.
52 virtual void EventPoll(PP_InputEvent* event) = 0;
53 // Get next event (blocking).
54 virtual void EventGet(PP_InputEvent* event) = 0;
55 // Get next event (blocking).
56 virtual void AudioInit16Bit(int frequency,
57 int channels,
58 int frame_count,
59 AUDIO_CALLBACK cb) = 0;
60 virtual void AudioStart() = 0;
61 virtual void AudioStop() = 0;
62 };
63
64 /* Currently, there is only an SDL implementation */
65 IMultimedia* MakeMultimediaSDL(int width, int heigth, const char* title);
66
67 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SEL_UNIVERASAL_MULTIMEDIA_H_ */
OLDNEW
« no previous file with comments | « src/trusted/sel_universal/build.scons ('k') | src/trusted/sel_universal/multimedia_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698