00001 // -*- C++ -*- 00002 00003 // $Id: media_timer.h 69284 2005-11-10 06:47:24Z ossama $ 00004 00005 /* 00006 * Copyright (c) 1995 Regents of the University of California. 00007 * All rights reserved. 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions 00011 * are met: 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 2. Redistributions in binary form must reproduce the above copyright 00015 * notice, this list of conditions and the following disclaimer in the 00016 * documentation and/or other materials provided with the distribution. 00017 * 3. All advertising materials mentioning features or use of this software 00018 * must display the following acknowledgement: 00019 * This product includes software developed by the Computer Systems 00020 * Engineering Group at Lawrence Berkeley Laboratory. 00021 * 4. Neither the name of the University nor of the Laboratory may be used 00022 * to endorse or promote products derived from this software without 00023 * specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 00026 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00028 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00029 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00030 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00031 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00032 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00033 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00034 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00035 * SUCH DAMAGE. 00036 * 00037 * @(#) $Header$ 00038 */ 00039 00040 #ifndef TAO_AV_MEDIA_TIMER_H 00041 #define TAO_AV_MEDIA_TIMER_H 00042 #include /**/ "ace/pre.h" 00043 00044 #include "tao/orbconf.h" 00045 #include "tao/Versioned_Namespace.h" 00046 00047 //long random (void); 00048 00049 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00050 00051 class MediaTimer 00052 { 00053 public: 00054 MediaTimer(); 00055 virtual ~MediaTimer(); 00056 static inline MediaTimer* instance() { return (instance_); } 00057 virtual ACE_UINT32 media_ts(); 00058 virtual ACE_UINT32 ref_ts(); 00059 inline ACE_UINT32 offset() const { return (offset_); } 00060 private: 00061 static MediaTimer* instance_; 00062 protected: 00063 ACE_UINT32 offset_; /* random offset */ 00064 }; 00065 00066 TAO_END_VERSIONED_NAMESPACE_DECL 00067 00068 #include /**/ "ace/post.h" 00069 #endif /* TAO_AV_MEDIA_TIMER_H */