Mike J. Chen 06e04e4c17 Add media/libaah_rtp
RTP library used to broadcast media from one device to a collection
of listeners.  Handles failures/retries/etc.

This is a squashed merge from master-tungsten of the following changes:

commit e1a5101fe627d71739a7c4263bb3a65c7bc44385
Author: Jason Simmons <jsimmons@google.com>
Date:   Fri Aug 12 13:24:21 2011 -0700

    Hold ThreadWrapper in a ref-counting pointer

    Change-Id: Iaf3343182e37bcc0ca99fbaf8f9bbb8c4984072a

commit 89b90d62e164ff3db27c9cba85255fc476d2dd96
Author: Jason Simmons <jsimmons@google.com>
Date:   Wed Aug 10 13:08:25 2011 -0700

    Update the Tungsten TX player to use HTTPBase

    Change-Id: I9f7ecf1b4b496cec1815284dbcdb958a43284169

commit 43be3231034ff8537fdd84422a7954780038671f
Author: John Grossman <johngro@google.com>
Date:   Mon Jun 27 18:59:12 2011 -0700

    Move libaah_rtp over from the vendor directory.

    Also move factor PipeEvent out into utils.

    Change-Id: Id3877c66efe22d771cf3ef4877107e431b828e37

Change-Id: I5fe1ea941c09204d7b33f15f4e2b2ab320dc468b
Signed-off-by: Mike J. Chen <mjchen@google.com>
Signed-off-by: John Grossman <johngro@google.com>
Signed-off-by: Jason Simmons <jsimmons@google.com>
2011-10-28 10:14:49 -04:00

48 lines
1.2 KiB
C++

/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __PIPE_EVENT_H__
#define __PIPE_EVENT_H__
namespace android {
class PipeEvent {
public:
PipeEvent();
~PipeEvent();
bool initCheck() const {
return ((pipe_[0] >= 0) && (pipe_[1] >= 0));
}
int getWakeupHandle() const { return pipe_[0]; }
// block until the event fires; returns true if the event fired and false if
// the wait timed out. Timeout is expressed in milliseconds; negative
// values mean wait forever.
bool wait(int timeout = -1);
void clearPendingEvents();
void setEvent();
private:
int pipe_[2];
};
} // namespace android
#endif // __PIPE_EVENT_H__