Skip to content

Commit

Permalink
Merge branch 'master' into devel/2019-render
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Nov 6, 2019
2 parents b5331e7 + 31884b3 commit 0822d3c
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 46 deletions.
2 changes: 1 addition & 1 deletion mythtv/external/nv-codec-headers/ffnvcodec.pc.in
Expand Up @@ -3,5 +3,5 @@ includedir=${prefix}/include

Name: ffnvcodec
Description: FFmpeg version of Nvidia Codec SDK headers
Version: 8.2.15.7
Version: 8.2.15.10
Cflags: -I${includedir}
26 changes: 15 additions & 11 deletions mythtv/external/nv-codec-headers/include/ffnvcodec/dynlink_cuda.h
Expand Up @@ -41,22 +41,23 @@
#define CU_CTX_SCHED_BLOCKING_SYNC 4

typedef int CUdevice;
typedef void* CUarray;
typedef void* CUcontext;
typedef void* CUstream;
typedef void* CUevent;
typedef void* CUfunction;
typedef void* CUmodule;
typedef void* CUtexObject;
typedef void* CUmipmappedArray;
typedef void* CUgraphicsResource;
typedef void* CUexternalMemory;
typedef void* CUexternalSemaphore;
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
typedef unsigned long long CUdeviceptr;
#else
typedef unsigned int CUdeviceptr;
#endif
typedef unsigned long long CUtexObject;

typedef struct CUarray_st *CUarray;
typedef struct CUctx_st *CUcontext;
typedef struct CUstream_st *CUstream;
typedef struct CUevent_st *CUevent;
typedef struct CUfunc_st *CUfunction;
typedef struct CUmod_st *CUmodule;
typedef struct CUmipmappedArray_st *CUmipmappedArray;
typedef struct CUgraphicsResource_st *CUgraphicsResource;
typedef struct CUextMemory_st *CUexternalMemory;
typedef struct CUextSemaphore_st *CUexternalSemaphore;

typedef enum cudaError_enum {
CUDA_SUCCESS = 0,
Expand Down Expand Up @@ -323,11 +324,13 @@ typedef CUresult CUDAAPI tcuCtxPopCurrent_v2(CUcontext *pctx);
typedef CUresult CUDAAPI tcuCtxDestroy_v2(CUcontext ctx);
typedef CUresult CUDAAPI tcuMemAlloc_v2(CUdeviceptr *dptr, size_t bytesize);
typedef CUresult CUDAAPI tcuMemAllocPitch_v2(CUdeviceptr *dptr, size_t *pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes);
typedef CUresult CUDAAPI tcuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream);
typedef CUresult CUDAAPI tcuMemFree_v2(CUdeviceptr dptr);
typedef CUresult CUDAAPI tcuMemcpy2D_v2(const CUDA_MEMCPY2D *pcopy);
typedef CUresult CUDAAPI tcuMemcpy2DAsync_v2(const CUDA_MEMCPY2D *pcopy, CUstream hStream);
typedef CUresult CUDAAPI tcuGetErrorName(CUresult error, const char** pstr);
typedef CUresult CUDAAPI tcuGetErrorString(CUresult error, const char** pstr);
typedef CUresult CUDAAPI tcuCtxGetDevice(CUdevice *device);

typedef CUresult CUDAAPI tcuStreamCreate(CUstream *phStream, unsigned int flags);
typedef CUresult CUDAAPI tcuStreamQuery(CUstream hStream);
Expand Down Expand Up @@ -359,6 +362,7 @@ typedef CUresult CUDAAPI tcuDestroyExternalMemory(CUexternalMemory extMem);
typedef CUresult CUDAAPI tcuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc);
typedef CUresult CUDAAPI tcuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc);
typedef CUresult CUDAAPI tcuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level);
typedef CUresult CUDAAPI tcuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray);

typedef CUresult CUDAAPI tcuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc);
typedef CUresult CUDAAPI tcuDestroyExternalSemaphore(CUexternalSemaphore extSem);
Expand Down
Expand Up @@ -150,11 +150,13 @@ typedef struct CudaFunctions {
tcuCtxDestroy_v2 *cuCtxDestroy;
tcuMemAlloc_v2 *cuMemAlloc;
tcuMemAllocPitch_v2 *cuMemAllocPitch;
tcuMemsetD8Async *cuMemsetD8Async;
tcuMemFree_v2 *cuMemFree;
tcuMemcpy2D_v2 *cuMemcpy2D;
tcuMemcpy2DAsync_v2 *cuMemcpy2DAsync;
tcuGetErrorName *cuGetErrorName;
tcuGetErrorString *cuGetErrorString;
tcuCtxGetDevice *cuCtxGetDevice;

tcuStreamCreate *cuStreamCreate;
tcuStreamQuery *cuStreamQuery;
Expand Down Expand Up @@ -185,6 +187,7 @@ typedef struct CudaFunctions {
tcuDestroyExternalMemory *cuDestroyExternalMemory;
tcuExternalMemoryGetMappedBuffer *cuExternalMemoryGetMappedBuffer;
tcuExternalMemoryGetMappedMipmappedArray *cuExternalMemoryGetMappedMipmappedArray;
tcuMipmappedArrayDestroy *cuMipmappedArrayDestroy;

tcuMipmappedArrayGetLevel *cuMipmappedArrayGetLevel;

Expand Down Expand Up @@ -272,11 +275,13 @@ static inline int cuda_load_functions(CudaFunctions **functions, void *logctx)
LOAD_SYMBOL(cuCtxDestroy, tcuCtxDestroy_v2, "cuCtxDestroy_v2");
LOAD_SYMBOL(cuMemAlloc, tcuMemAlloc_v2, "cuMemAlloc_v2");
LOAD_SYMBOL(cuMemAllocPitch, tcuMemAllocPitch_v2, "cuMemAllocPitch_v2");
LOAD_SYMBOL(cuMemsetD8Async, tcuMemsetD8Async, "cuMemsetD8Async");
LOAD_SYMBOL(cuMemFree, tcuMemFree_v2, "cuMemFree_v2");
LOAD_SYMBOL(cuMemcpy2D, tcuMemcpy2D_v2, "cuMemcpy2D_v2");
LOAD_SYMBOL(cuMemcpy2DAsync, tcuMemcpy2DAsync_v2, "cuMemcpy2DAsync_v2");
LOAD_SYMBOL(cuGetErrorName, tcuGetErrorName, "cuGetErrorName");
LOAD_SYMBOL(cuGetErrorString, tcuGetErrorString, "cuGetErrorString");
LOAD_SYMBOL(cuCtxGetDevice, tcuCtxGetDevice, "cuCtxGetDevice");

LOAD_SYMBOL(cuStreamCreate, tcuStreamCreate, "cuStreamCreate");
LOAD_SYMBOL(cuStreamQuery, tcuStreamQuery, "cuStreamQuery");
Expand Down Expand Up @@ -309,6 +314,7 @@ static inline int cuda_load_functions(CudaFunctions **functions, void *logctx)
LOAD_SYMBOL_OPT(cuExternalMemoryGetMappedBuffer, tcuExternalMemoryGetMappedBuffer, "cuExternalMemoryGetMappedBuffer");
LOAD_SYMBOL_OPT(cuExternalMemoryGetMappedMipmappedArray, tcuExternalMemoryGetMappedMipmappedArray, "cuExternalMemoryGetMappedMipmappedArray");
LOAD_SYMBOL_OPT(cuMipmappedArrayGetLevel, tcuMipmappedArrayGetLevel, "cuMipmappedArrayGetLevel");
LOAD_SYMBOL_OPT(cuMipmappedArrayDestroy, tcuMipmappedArrayDestroy, "cuMipmappedArrayDestroy");

LOAD_SYMBOL_OPT(cuImportExternalSemaphore, tcuImportExternalSemaphore, "cuImportExternalSemaphore");
LOAD_SYMBOL_OPT(cuDestroyExternalSemaphore, tcuDestroyExternalSemaphore, "cuDestroyExternalSemaphore");
Expand Down
50 changes: 21 additions & 29 deletions mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp
Expand Up @@ -207,36 +207,41 @@ void DVBStreamData::Reset(uint desired_netid, uint desired_tsid,
}

/** \fn DVBStreamData::HandleTables(uint pid, const PSIPTable&)
* \brief Assembles PSIP packets and processes them.
* \todo This is just a stub.
* \brief Process PSIP packets.
*/
bool DVBStreamData::HandleTables(uint pid, const PSIPTable &psip)
{
if (MPEGStreamData::HandleTables(pid, psip))
return true;

// If the user specified a network ID and that network ID is a NITo then change that NITo into
// the NIT and change the NIT into a NITo. See ticket #7486.
if (_dvb_real_network_id > 0)
{
if ((psip.TableID() == TableID::NIT && psip.TableIDExtension() != (uint)_dvb_real_network_id) ||
(psip.TableID() == TableID::NITo && psip.TableIDExtension() == (uint)_dvb_real_network_id) )
{
NetworkInformationTable *nit = new NetworkInformationTable(psip);
if (!nit->Mutate())
{
delete nit;
return true;
}
bool retval = HandleTables(pid, *nit);
delete nit;
return retval;
}
}

if (IsRedundant(pid, psip))
return true;

switch (psip.TableID())
{
case TableID::NIT:
{
if (_dvb_real_network_id >= 0 && psip.TableIDExtension() != (uint)_dvb_real_network_id)
{
NetworkInformationTable *nit = new NetworkInformationTable(psip);
if (!nit->Mutate())
{
delete nit;
return true;
}
bool retval = HandleTables(pid, *nit);
delete nit;
return retval;
}

_nit_status.SetSectionSeen(psip.Version(), psip.Section(),
psip.LastSection());
psip.LastSection());

if (_cache_tables)
{
Expand Down Expand Up @@ -292,19 +297,6 @@ bool DVBStreamData::HandleTables(uint pid, const PSIPTable &psip)
}
case TableID::NITo:
{
if (_dvb_real_network_id >= 0 && psip.TableIDExtension() == (uint)_dvb_real_network_id)
{
NetworkInformationTable *nit = new NetworkInformationTable(psip);
if (!nit->Mutate())
{
delete nit;
return true;
}
bool retval = HandleTables(pid, *nit);
delete nit;
return retval;
}

_nito_status.SetSectionSeen(psip.Version(), psip.Section(),
psip.LastSection());
NetworkInformationTable nit(psip);
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp
Expand Up @@ -681,11 +681,11 @@ bool MPEGStreamData::IsRedundant(uint pid, const PSIPTable &psip) const
}

/** \fn MPEGStreamData::HandleTables(uint pid, const PSIPTable &psip)
* \brief Assembles PSIP packets and processes them.
* \brief Process PSIP packets.
*/
bool MPEGStreamData::HandleTables(uint pid, const PSIPTable &psip)
{
if (IsRedundant(pid, psip))
if (MPEGStreamData::IsRedundant(pid, psip))
return true;

const int version = psip.Version();
Expand Down Expand Up @@ -936,7 +936,7 @@ void MPEGStreamData::HandleTSTables(const TSPacket* tspacket)

// Don't decode redundant packets,
// but if it is a desired PAT or PMT emit a "heartbeat" signal.
if (IsRedundant(tspacket->PID(), *psip))
if (MPEGStreamData::IsRedundant(tspacket->PID(), *psip))
{
if (TableID::PAT == psip->TableID())
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mpeg/tspacket.h
Expand Up @@ -167,7 +167,7 @@ class MTV_PUBLIC TSPacket : public TSHeader
{
friend class PESPacket;
public:
/* note: payload is intenionally left uninitialized */
/* note: payload is intentionally left uninitialized */
// cppcheck-suppress uninitMemberVar
TSPacket(void) : TSHeader() { }

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/recorders/dvbstreamhandler.cpp
Expand Up @@ -125,7 +125,7 @@ void DVBStreamHandler::run(void)
/** \fn DVBStreamHandler::RunTS(void)
* \brief Uses TS filtering devices to read a DVB device for tables & data
*
* This supports all types of MPEG based stream data, but is extreemely
* This supports all types of MPEG based stream data, but is extremely
* slow with DVB over USB 1.0 devices which for efficiency reasons buffer
* a stream until a full block transfer buffer full of the requested
* tables is available. This takes a very long time when you are just
Expand Down

0 comments on commit 0822d3c

Please sign in to comment.