DtvKit_ATSC3.0
Loading...
Searching...
No Matches
atsc_core_common_ring_queue.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3 *
4 * This file is part of a DTVKit Software Component
5 * You are permitted to copy, modify or distribute this file subject to the terms
6 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
7 *
8 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
9 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
10 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * If you or your organisation is not a member of DTVKit then you have access
13 * to this source code outside of the terms of the licence agreement
14 * and you are expected to delete this and any associated files immediately.
15 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
16 *******************************************************************************/
17
18#ifndef ATSC_CORE_COMMON_RING_QUEUE_H_
19#define ATSC_CORE_COMMON_RING_QUEUE_H_
20
21#pragma once
22#include <stdlib.h>
23#include <stdio.h>
24#include <string.h>
25#include <pthread.h>
26#include <unistd.h>
27
28#include "atsc_basetype.h"
29
38class CQueue
39{
40public:
47CQueue(int32_t iSize , int32_t iWidth);
48
55~CQueue(void);
56
63int32_t GetFrameSize(int32_t iCount);
64
71UINT_64 ReadRingQueue(uint8_t* pBuffer,uint32_t *pSize);
72
79UINT_64 WriteItem2RingQueue(uint8_t * pBuffer1, uint32_t iSize1, uint8_t * pBuffer2, uint32_t iSize2);
80
87UINT_64 WriteItem3RingQueue(uint8_t * pBuffer1, uint32_t iSize1, uint8_t * pBuffer2, uint32_t iSize2, uint8_t * pBuffer3, uint32_t iSize3);
88
95UINT_64 WriteRingQueue(uint8_t* pBuffer,uint32_t iSize);
96
103UINT_64 GetQueueLen( void );
104
111void ResetQueue( void );
112
113private:
114 uint8_t *mpDataBuffer;
115 uint32_t *mpDataCount;
116 UINT_64 mRingBuffCount,mHeadCount,mTailCount;
117 UINT_64 mRingBuffSize;
118 UINT_64 mWidth;
120 pthread_mutex_t mutexlock;
121};
122
123#endif /* ATSC_CORE_COMMON_RING_QUEUE_H_ */
124
125
126
127
Definition atsc_core_common_ring_queue.h:39
UINT_64 WriteItem3RingQueue(uint8_t *pBuffer1, uint32_t iSize1, uint8_t *pBuffer2, uint32_t iSize2, uint8_t *pBuffer3, uint32_t iSize3)
Write 3 ring queue buffers.
UINT_64 GetQueueLen(void)
read queue length
UINT_64 WriteItem2RingQueue(uint8_t *pBuffer1, uint32_t iSize1, uint8_t *pBuffer2, uint32_t iSize2)
Write 2 ring queue buffers.
UINT_64 ReadRingQueue(uint8_t *pBuffer, uint32_t *pSize)
Read ring Queue size.
CQueue(int32_t iSize, int32_t iWidth)
Constructor of CQueue.
UINT_64 WriteRingQueue(uint8_t *pBuffer, uint32_t iSize)
Write ring queue buffer.
~CQueue(void)
Distructor of CQueue.
int32_t GetFrameSize(int32_t iCount)
read number of frames
void ResetQueue(void)
Reset queue.