• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 // -*- c++ -*-
19 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
20 
21 //                     P V M F _ T I M E S T A M P
22 
23 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
24 
25 /**
26  *  @file pvmf_timestamp.h
27  *  @brief This file defines the PV Multimedia Framework (PVMF) timestamp class
28  *  which holds a 32-bit continuous timestamp that periodically wraps back to zero.
29  *
30  */
31 
32 #ifndef PVMF_TIMESTAMP_H_INCLUDED
33 #define PVMF_TIMESTAMP_H_INCLUDED
34 
35 #ifndef OSCL_BASE_H_INCLUDED
36 #include "oscl_base.h"
37 #endif
38 
39 
40 /**
41  * PVMFTimestamp is a circular (i.e., value wraps after max int)
42  * 32-bit timestamp container.
43  */
44 typedef uint32 PVMFTimestamp;
45 
46 const PVMFTimestamp PVMFTIMESTAMP_LESSTHAN_THRESHOLD = 0x80000000;
47 
48 /**
49  * Compares two timestamps and reports if the first occurred before (is less than)
50  * the second value.
51  * @param a first timestamp value in the comparison
52  * @param b second timestamp value in the comparison
53  * @return true if a < b, false otherwise.
54  *
55  */
56 OSCL_IMPORT_REF bool lessthan(const PVMFTimestamp& a, const PVMFTimestamp& b,
57                               PVMFTimestamp threshold = PVMFTIMESTAMP_LESSTHAN_THRESHOLD);
58 
59 
60 typedef struct PVMFTimeValue
61 {
62     uint32 time_val;
63     uint32 time_units;
64 } _PVMFTimeValue;
65 
66 #endif
67