mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-10-21 15:57:12 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc92b6d2f3 | ||
|
|
9af0e9f539 | ||
|
|
e4db5c2c18 | ||
|
|
9b8886a6f5 | ||
|
|
f018a71a8a | ||
|
|
b0af84ead1 | ||
|
|
289782c6f3 | ||
|
|
ee557e83c6 | ||
|
|
2bd4b9f721 | ||
|
|
fa6ae80940 | ||
|
|
71c3191e0c | ||
|
|
a614924502 | ||
|
|
a57e947d71 |
No files matched your search
@@ -8,6 +8,8 @@
|
|||||||
<string>Moonlight</string>
|
<string>Moonlight</string>
|
||||||
<key>LSSupportsGameMode</key>
|
<key>LSSupportsGameMode</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSApplicationUpdateCycleEnabled</key>
|
||||||
|
<false/>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>Stream games and other applications from another PC</string>
|
<string>Stream games and other applications from another PC</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ IdentityManager::getSslKey()
|
|||||||
|
|
||||||
BUF_MEM* mem;
|
BUF_MEM* mem;
|
||||||
BIO_get_mem_ptr(bio, &mem);
|
BIO_get_mem_ptr(bio, &mem);
|
||||||
m_CachedSslKey = QSslKey(QByteArray(mem->data, (int)mem->length), QSsl::Rsa);
|
m_CachedSslKey = QSslKey(QByteArray(mem->data, (int)mem->length), getSslCertificate().publicKey().algorithm());
|
||||||
|
|
||||||
BIO_free(bio);
|
BIO_free(bio);
|
||||||
EVP_PKEY_free(pk);
|
EVP_PKEY_free(pk);
|
||||||
|
|||||||
@@ -140,6 +140,9 @@ NvPairingManager::getSignatureFromPemCert(const QByteArray& certificate)
|
|||||||
|
|
||||||
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
|
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
|
||||||
BIO_free_all(bio);
|
BIO_free_all(bio);
|
||||||
|
if (cert == nullptr) {
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
QByteArray signature = getSignatureFromCert(cert);
|
QByteArray signature = getSignatureFromCert(cert);
|
||||||
X509_free(cert);
|
X509_free(cert);
|
||||||
@@ -159,9 +162,15 @@ NvPairingManager::verifySignature(const QByteArray& data, const QByteArray& sign
|
|||||||
|
|
||||||
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
|
X509* cert = PEM_read_bio_X509(bio, nullptr, nullptr, nullptr);
|
||||||
BIO_free_all(bio);
|
BIO_free_all(bio);
|
||||||
|
if (cert == nullptr) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
EVP_PKEY* pubKey = X509_get_pubkey(cert);
|
EVP_PKEY* pubKey = X509_get_pubkey(cert);
|
||||||
THROW_BAD_ALLOC_IF_NULL(pubKey);
|
if (pubKey == nullptr) {
|
||||||
|
X509_free(cert);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
EVP_MD_CTX* mdctx = EVP_MD_CTX_create();
|
EVP_MD_CTX* mdctx = EVP_MD_CTX_create();
|
||||||
THROW_BAD_ALLOC_IF_NULL(mdctx);
|
THROW_BAD_ALLOC_IF_NULL(mdctx);
|
||||||
@@ -278,7 +287,7 @@ NvPairingManager::pair(QString appVersion, QString pin, QSslCertificate& serverC
|
|||||||
}
|
}
|
||||||
|
|
||||||
QByteArray challengeResponseData = decrypt(m_Http.getXmlStringFromHex(challengeXml, "challengeresponse"), aesKey);
|
QByteArray challengeResponseData = decrypt(m_Http.getXmlStringFromHex(challengeXml, "challengeresponse"), aesKey);
|
||||||
if (challengeResponseData.size() < hashLength) {
|
if (challengeResponseData.size() < hashLength + 16) {
|
||||||
qCritical() << "Invalid challengeresponse at stage #2";
|
qCritical() << "Invalid challengeresponse at stage #2";
|
||||||
m_Http.openConnectionToString(m_Http.m_BaseUrlHttp, "unpair", nullptr, REQUEST_TIMEOUT_MS);
|
m_Http.openConnectionToString(m_Http.m_BaseUrlHttp, "unpair", nullptr, REQUEST_TIMEOUT_MS);
|
||||||
return PairState::FAILED;
|
return PairState::FAILED;
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ DxVsyncSource::DxVsyncSource(Pacer* pacer) :
|
|||||||
m_LastMonitor(nullptr)
|
m_LastMonitor(nullptr)
|
||||||
{
|
{
|
||||||
SDL_zero(m_WaitForVblankEventParams);
|
SDL_zero(m_WaitForVblankEventParams);
|
||||||
|
m_WaitForVblankEventParams.VidPnSourceId = D3DDDI_ID_UNINITIALIZED;
|
||||||
|
SDL_zero(m_AdapterLuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
DxVsyncSource::~DxVsyncSource()
|
DxVsyncSource::~DxVsyncSource()
|
||||||
@@ -72,41 +74,43 @@ bool DxVsyncSource::isAsync()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxVsyncSource::waitForVsync()
|
bool DxVsyncSource::waitForVsync()
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
|
||||||
// If the monitor has changed from last time, open the new adapter
|
// If the monitor has changed from last time, open the new adapter
|
||||||
HMONITOR currentMonitor = MonitorFromWindow(m_Window, MONITOR_DEFAULTTONEAREST);
|
HMONITOR currentMonitor = MonitorFromWindow(m_Window, MONITOR_DEFAULTTONEAREST);
|
||||||
if (currentMonitor != m_LastMonitor) {
|
if (!currentMonitor || currentMonitor != m_LastMonitor) {
|
||||||
|
// Close the old adapter
|
||||||
|
if (m_WaitForVblankEventParams.hAdapter != 0) {
|
||||||
|
D3DKMT_CLOSEADAPTER closeAdapterParams = {};
|
||||||
|
closeAdapterParams.hAdapter = m_WaitForVblankEventParams.hAdapter;
|
||||||
|
m_D3DKMTCloseAdapter(&closeAdapterParams);
|
||||||
|
m_WaitForVblankEventParams.hAdapter = 0;
|
||||||
|
}
|
||||||
|
m_LastMonitor = nullptr;
|
||||||
|
|
||||||
|
// We can't wait if we're not on any monitor
|
||||||
|
if (!currentMonitor) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
MONITORINFOEXA monitorInfo = {};
|
MONITORINFOEXA monitorInfo = {};
|
||||||
monitorInfo.cbSize = sizeof(monitorInfo);
|
monitorInfo.cbSize = sizeof(monitorInfo);
|
||||||
if (!GetMonitorInfoA(currentMonitor, &monitorInfo)) {
|
if (!GetMonitorInfoA(currentMonitor, &monitorInfo)) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"GetMonitorInfo() failed: %d",
|
"GetMonitorInfo() failed: %d",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVMODEA monitorMode;
|
DEVMODEA monitorMode = {};
|
||||||
monitorMode.dmSize = sizeof(monitorMode);
|
monitorMode.dmSize = sizeof(monitorMode);
|
||||||
if (!EnumDisplaySettingsA(monitorInfo.szDevice, ENUM_CURRENT_SETTINGS, &monitorMode)) {
|
if (!EnumDisplaySettingsA(monitorInfo.szDevice, ENUM_CURRENT_SETTINGS, &monitorMode)) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"EnumDisplaySettings() failed: %d",
|
"EnumDisplaySettings() failed: %d",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
return;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
|
||||||
"Monitor changed: %s %d Hz",
|
|
||||||
monitorInfo.szDevice,
|
|
||||||
monitorMode.dmDisplayFrequency);
|
|
||||||
|
|
||||||
// Close the old adapter
|
|
||||||
if (m_WaitForVblankEventParams.hAdapter != 0) {
|
|
||||||
D3DKMT_CLOSEADAPTER closeAdapterParams = {};
|
|
||||||
closeAdapterParams.hAdapter = m_WaitForVblankEventParams.hAdapter;
|
|
||||||
m_D3DKMTCloseAdapter(&closeAdapterParams);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
D3DKMT_OPENADAPTERFROMHDC openAdapterParams = {};
|
D3DKMT_OPENADAPTERFROMHDC openAdapterParams = {};
|
||||||
@@ -115,7 +119,7 @@ void DxVsyncSource::waitForVsync()
|
|||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"CreateDC() failed: %d",
|
"CreateDC() failed: %d",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the new adapter
|
// Open the new adapter
|
||||||
@@ -126,21 +130,38 @@ void DxVsyncSource::waitForVsync()
|
|||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"D3DKMTOpenAdapterFromHdc() failed: %x",
|
"D3DKMTOpenAdapterFromHdc() failed: %x",
|
||||||
status);
|
status);
|
||||||
return;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// VidPnSourceId is scoped to the adapter, so we must also check the adapter LUID
|
||||||
|
if (m_AdapterLuid.LowPart != openAdapterParams.AdapterLuid.LowPart ||
|
||||||
|
m_AdapterLuid.HighPart != openAdapterParams.AdapterLuid.HighPart ||
|
||||||
|
m_WaitForVblankEventParams.VidPnSourceId != openAdapterParams.VidPnSourceId) {
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Monitor changed: %s %d Hz",
|
||||||
|
monitorInfo.szDevice,
|
||||||
|
monitorMode.dmDisplayFrequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_WaitForVblankEventParams.hAdapter = openAdapterParams.hAdapter;
|
m_WaitForVblankEventParams.hAdapter = openAdapterParams.hAdapter;
|
||||||
m_WaitForVblankEventParams.hDevice = 0;
|
m_WaitForVblankEventParams.hDevice = 0;
|
||||||
m_WaitForVblankEventParams.VidPnSourceId = openAdapterParams.VidPnSourceId;
|
m_WaitForVblankEventParams.VidPnSourceId = openAdapterParams.VidPnSourceId;
|
||||||
|
|
||||||
|
m_AdapterLuid = openAdapterParams.AdapterLuid;
|
||||||
m_LastMonitor = currentMonitor;
|
m_LastMonitor = currentMonitor;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = m_D3DKMTWaitForVerticalBlankEvent(&m_WaitForVblankEventParams);
|
status = m_D3DKMTWaitForVerticalBlankEvent(&m_WaitForVblankEventParams);
|
||||||
if (status != STATUS_SUCCESS) {
|
if (status != STATUS_SUCCESS) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
if (status != STATUS_GRAPHICS_PRESENT_OCCLUDED) {
|
||||||
"D3DKMTWaitForVerticalBlankEvent() failed: %x",
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
status);
|
"D3DKMTWaitForVerticalBlankEvent() failed: %x",
|
||||||
return;
|
status);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_LastMonitor = nullptr;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ typedef UINT D3DKMT_HANDLE;
|
|||||||
typedef UINT D3DDDI_VIDEO_PRESENT_SOURCE_ID;
|
typedef UINT D3DDDI_VIDEO_PRESENT_SOURCE_ID;
|
||||||
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
|
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
|
||||||
#define STATUS_GRAPHICS_PRESENT_OCCLUDED ((NTSTATUS)0xC01E0006L)
|
#define STATUS_GRAPHICS_PRESENT_OCCLUDED ((NTSTATUS)0xC01E0006L)
|
||||||
|
#define D3DDDI_ID_UNINITIALIZED (UINT)(~0)
|
||||||
typedef struct _D3DKMT_OPENADAPTERFROMHDC {
|
typedef struct _D3DKMT_OPENADAPTERFROMHDC {
|
||||||
HDC hDc;
|
HDC hDc;
|
||||||
D3DKMT_HANDLE hAdapter;
|
D3DKMT_HANDLE hAdapter;
|
||||||
@@ -39,13 +40,14 @@ public:
|
|||||||
|
|
||||||
virtual bool isAsync() override;
|
virtual bool isAsync() override;
|
||||||
|
|
||||||
virtual void waitForVsync() override;
|
virtual bool waitForVsync() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Pacer* m_Pacer;
|
Pacer* m_Pacer;
|
||||||
HMODULE m_Gdi32Handle;
|
HMODULE m_Gdi32Handle;
|
||||||
HWND m_Window;
|
HWND m_Window;
|
||||||
HMONITOR m_LastMonitor;
|
HMONITOR m_LastMonitor;
|
||||||
|
LUID m_AdapterLuid;
|
||||||
D3DKMT_WAITFORVERTICALBLANKEVENT m_WaitForVblankEventParams;
|
D3DKMT_WAITFORVERTICALBLANKEVENT m_WaitForVblankEventParams;
|
||||||
|
|
||||||
PFND3DKMTOPENADAPTERFROMHDC m_D3DKMTOpenAdapterFromHdc;
|
PFND3DKMTOPENADAPTERFROMHDC m_D3DKMTOpenAdapterFromHdc;
|
||||||
|
|||||||
@@ -115,13 +115,20 @@ int Pacer::vsyncThread(void *context)
|
|||||||
while (!me->m_Stopping) {
|
while (!me->m_Stopping) {
|
||||||
if (async) {
|
if (async) {
|
||||||
// Wait for the VSync source to invoke signalVsync() or 100ms to elapse
|
// Wait for the VSync source to invoke signalVsync() or 100ms to elapse
|
||||||
me->m_FrameQueueLock.lock();
|
QMutexLocker locker(&me->m_FrameQueueLock);
|
||||||
me->m_VsyncSignalled.wait(&me->m_FrameQueueLock, 100);
|
me->m_VsyncSignalled.wait(&me->m_FrameQueueLock, 100);
|
||||||
me->m_FrameQueueLock.unlock();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Let the VSync source wait in the context of our thread
|
// Let the VSync source wait in the context of our thread
|
||||||
me->m_VsyncSource->waitForVsync();
|
if (!me->m_VsyncSource->waitForVsync()) {
|
||||||
|
// Fall back to a fixed delay if the VSync source fails
|
||||||
|
//
|
||||||
|
// NB: We don't actually expect signalVsync() to be called, since
|
||||||
|
// this is a synchronous VSync source, but we wait on m_VsyncSignalled
|
||||||
|
// anyway so that the destructor can immediately wake us on shutdown.
|
||||||
|
QMutexLocker locker(&me->m_FrameQueueLock);
|
||||||
|
me->m_VsyncSignalled.wait(&me->m_FrameQueueLock, 1000 / me->m_DisplayFps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me->m_Stopping) {
|
if (me->m_Stopping) {
|
||||||
@@ -148,24 +155,25 @@ int Pacer::renderThread(void* context)
|
|||||||
// Wait for the renderer to be ready for the next frame
|
// Wait for the renderer to be ready for the next frame
|
||||||
me->m_VsyncRenderer->waitToRender();
|
me->m_VsyncRenderer->waitToRender();
|
||||||
|
|
||||||
// Acquire the frame queue lock to protect the queue and
|
AVFrame* frame;
|
||||||
// the not empty condition
|
{
|
||||||
me->m_FrameQueueLock.lock();
|
// Acquire the frame queue lock to protect the queue and
|
||||||
|
// the not empty condition
|
||||||
|
QMutexLocker locker(&me->m_FrameQueueLock);
|
||||||
|
|
||||||
// Wait for a frame to be ready to render
|
// Wait for a frame to be ready to render
|
||||||
while (!me->m_Stopping && me->m_RenderQueue.isEmpty()) {
|
while (!me->m_Stopping && me->m_RenderQueue.isEmpty()) {
|
||||||
me->m_RenderQueueNotEmpty.wait(&me->m_FrameQueueLock);
|
me->m_RenderQueueNotEmpty.wait(&me->m_FrameQueueLock);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me->m_Stopping) {
|
||||||
|
// Exit this thread
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
frame = me->m_RenderQueue.dequeue();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me->m_Stopping) {
|
|
||||||
// Exit this thread
|
|
||||||
me->m_FrameQueueLock.unlock();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
AVFrame* frame = me->m_RenderQueue.dequeue();
|
|
||||||
me->m_FrameQueueLock.unlock();
|
|
||||||
|
|
||||||
me->renderFrame(frame);
|
me->renderFrame(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +257,7 @@ void Pacer::handleVsync(int timeUntilNextVsyncMillis)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Stopping) {
|
if (m_Stopping || m_PacingQueue.isEmpty()) {
|
||||||
m_FrameQueueLock.unlock();
|
m_FrameQueueLock.unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -349,7 +357,7 @@ void Pacer::renderFrame(AVFrame* frame)
|
|||||||
av_frame_free(&frame);
|
av_frame_free(&frame);
|
||||||
|
|
||||||
// Drop frames if we have too many queued up for a while
|
// Drop frames if we have too many queued up for a while
|
||||||
m_FrameQueueLock.lock();
|
QMutexLocker frameQueueLocker(&m_FrameQueueLock);
|
||||||
|
|
||||||
int frameDropTarget;
|
int frameDropTarget;
|
||||||
|
|
||||||
@@ -382,13 +390,11 @@ void Pacer::renderFrame(AVFrame* frame)
|
|||||||
AVFrame* frame = m_RenderQueue.dequeue();
|
AVFrame* frame = m_RenderQueue.dequeue();
|
||||||
|
|
||||||
// Drop the lock while we call av_frame_free()
|
// Drop the lock while we call av_frame_free()
|
||||||
m_FrameQueueLock.unlock();
|
frameQueueLocker.unlock();
|
||||||
m_VideoStats->pacerDroppedFrames++;
|
m_VideoStats->pacerDroppedFrames++;
|
||||||
av_frame_free(&frame);
|
av_frame_free(&frame);
|
||||||
m_FrameQueueLock.lock();
|
frameQueueLocker.relock();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_FrameQueueLock.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pacer::dropFrameForEnqueue(QQueue<AVFrame*>& queue)
|
void Pacer::dropFrameForEnqueue(QQueue<AVFrame*>& queue)
|
||||||
|
|||||||
@@ -22,9 +22,10 @@ public:
|
|||||||
// sources require calls to waitForVsync().
|
// sources require calls to waitForVsync().
|
||||||
virtual bool isAsync() = 0;
|
virtual bool isAsync() = 0;
|
||||||
|
|
||||||
virtual void waitForVsync() {
|
virtual bool waitForVsync() {
|
||||||
// Synchronous sources must implement waitForVsync()!
|
// Synchronous sources must implement waitForVsync()!
|
||||||
SDL_assert(false);
|
SDL_assert(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+25
-3
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* h264bitstream - a library for reading and writing H.264 video
|
||||||
|
* Copyright (C) 2005-2007 Auroras Entertainment, LLC
|
||||||
|
* Copyright (C) 2008-2011 Avail-TVN
|
||||||
|
*
|
||||||
|
* Written by Alex Izvorski <aizvorski@gmail.com> and Alex Giladi <alex.giladi@gmail.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef _H264_BS_H
|
#ifndef _H264_BS_H
|
||||||
#define _H264_BS_H 1
|
#define _H264_BS_H 1
|
||||||
|
|
||||||
@@ -79,7 +101,7 @@ static inline int bs_eof(bs_t* b) { if (b->p >= b->end) { return 1; } else { ret
|
|||||||
|
|
||||||
static inline int bs_overrun(bs_t* b) { if (b->p > b->end) { return 1; } else { return 0; } }
|
static inline int bs_overrun(bs_t* b) { if (b->p > b->end) { return 1; } else { return 0; } }
|
||||||
|
|
||||||
static inline int bs_pos(bs_t* b) { if (b->p > b->end) { return (b->end - b->start); } else { return (b->p - b->start); } }
|
static inline int bs_pos(bs_t* b) { if (b->p > b->end) { return (int)(b->end - b->start); } else { return (int)(b->p - b->start); } }
|
||||||
|
|
||||||
static inline uint32_t bs_read_u1(bs_t* b)
|
static inline uint32_t bs_read_u1(bs_t* b)
|
||||||
{
|
{
|
||||||
@@ -186,7 +208,7 @@ static inline void bs_write_u(bs_t* b, int n, uint32_t v)
|
|||||||
int i;
|
int i;
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
bs_write_u1(b, (v >> ( n - i - 1 ))&0x01 );
|
bs_write_u1(b, (n - i - 1 >= 32) ? 0 : ((v >> ( n - i - 1 ))&0x01) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +217,7 @@ static inline void bs_write_u8(bs_t* b, uint32_t v)
|
|||||||
#ifdef FAST_U8
|
#ifdef FAST_U8
|
||||||
if (b->bits_left == 8 && ! bs_eof(b)) // can do fast write
|
if (b->bits_left == 8 && ! bs_eof(b)) // can do fast write
|
||||||
{
|
{
|
||||||
b->p[0] = v;
|
b->p[0] = (uint8_t)v;
|
||||||
b->p++;
|
b->p++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* h264bitstream - a library for reading and writing H.264 video
|
||||||
|
* Copyright (C) 2005-2007 Auroras Entertainment, LLC
|
||||||
|
* Copyright (C) 2008-2011 Avail-TVN
|
||||||
|
*
|
||||||
|
* Written by Alex Izvorski <aizvorski@gmail.com> and Alex Giladi <alex.giladi@gmail.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* h264bitstream - a library for reading and writing H.264 video
|
||||||
|
* Copyright (C) 2005-2007 Auroras Entertainment, LLC
|
||||||
|
* Copyright (C) 2008-2011 Avail-TVN
|
||||||
|
* Copyright (C) 2012 Alex Izvorski
|
||||||
|
*
|
||||||
|
* Written by Alex Izvorski <aizvorski@gmail.com> and Alex Giladi <alex.giladi@gmail.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -361,6 +384,11 @@ void write_seq_parameter_set_rbsp(sps_t* sps, bs_t* b)
|
|||||||
}
|
}
|
||||||
else if( sps->pic_order_cnt_type == 1 )
|
else if( sps->pic_order_cnt_type == 1 )
|
||||||
{
|
{
|
||||||
|
if (sps->num_ref_frames_in_pic_order_cnt_cycle > 256)
|
||||||
|
{
|
||||||
|
sps->num_ref_frames_in_pic_order_cnt_cycle = 256;
|
||||||
|
}
|
||||||
|
|
||||||
bs_write_u1(b, sps->delta_pic_order_always_zero_flag);
|
bs_write_u1(b, sps->delta_pic_order_always_zero_flag);
|
||||||
bs_write_se(b, sps->offset_for_non_ref_pic);
|
bs_write_se(b, sps->offset_for_non_ref_pic);
|
||||||
bs_write_se(b, sps->offset_for_top_to_bottom_field);
|
bs_write_se(b, sps->offset_for_top_to_bottom_field);
|
||||||
@@ -506,6 +534,11 @@ void write_vui_parameters(sps_t* sps, bs_t* b)
|
|||||||
|
|
||||||
void write_hrd_parameters(hrd_t* hrd, bs_t* b)
|
void write_hrd_parameters(hrd_t* hrd, bs_t* b)
|
||||||
{
|
{
|
||||||
|
if (hrd->cpb_cnt_minus1 > 31)
|
||||||
|
{
|
||||||
|
hrd->cpb_cnt_minus1 = 31;
|
||||||
|
}
|
||||||
|
|
||||||
bs_write_ue(b, hrd->cpb_cnt_minus1);
|
bs_write_ue(b, hrd->cpb_cnt_minus1);
|
||||||
bs_write_u(b, 4, hrd->bit_rate_scale);
|
bs_write_u(b, 4, hrd->bit_rate_scale);
|
||||||
bs_write_u(b, 4, hrd->cpb_size_scale);
|
bs_write_u(b, 4, hrd->cpb_size_scale);
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* h264bitstream - a library for reading and writing H.264 video
|
||||||
|
* Copyright (C) 2005-2007 Auroras Entertainment, LLC
|
||||||
|
* Copyright (C) 2008-2011 Avail-TVN
|
||||||
|
*
|
||||||
|
* Written by Alex Izvorski <aizvorski@gmail.com> and Alex Giladi <alex.giladi@gmail.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef _H264_STREAM_H
|
#ifndef _H264_STREAM_H
|
||||||
#define _H264_STREAM_H 1
|
#define _H264_STREAM_H 1
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ TEMPLATE = lib
|
|||||||
# Build a static library
|
# Build a static library
|
||||||
CONFIG += staticlib
|
CONFIG += staticlib
|
||||||
|
|
||||||
# Disable warnings
|
|
||||||
CONFIG += warn_off
|
|
||||||
|
|
||||||
# Include global qmake defs
|
# Include global qmake defs
|
||||||
include(../globaldefs.pri)
|
include(../globaldefs.pri)
|
||||||
|
|
||||||
|
|||||||
Submodule moonlight-common-c/moonlight-common-c updated: f900dd4767...04053843c9.
@@ -250,7 +250,7 @@ if not x%QT_PATH:\5.=%==x%QT_PATH% (
|
|||||||
set WINDEPLOYQT_ARGS=--no-qmltooling --no-virtualkeyboard
|
set WINDEPLOYQT_ARGS=--no-qmltooling --no-virtualkeyboard
|
||||||
) else (
|
) else (
|
||||||
rem Qt 6.8+
|
rem Qt 6.8+
|
||||||
set WINDEPLOYQT_ARGS=--no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types qmltooling,generic --no-ffmpeg
|
set WINDEPLOYQT_ARGS=--no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types qmltooling,generic --no-ffmpeg --force-openssl
|
||||||
set WINDEPLOYQT_ARGS=!WINDEPLOYQT_ARGS! --no-quickcontrols2fusion --no-quickcontrols2imagine --no-quickcontrols2universal
|
set WINDEPLOYQT_ARGS=!WINDEPLOYQT_ARGS! --no-quickcontrols2fusion --no-quickcontrols2imagine --no-quickcontrols2universal
|
||||||
set WINDEPLOYQT_ARGS=!WINDEPLOYQT_ARGS! --no-quickcontrols2fusionstyleimpl --no-quickcontrols2imaginestyleimpl --no-quickcontrols2universalstyleimpl --no-quickcontrols2windowsstyleimpl --no-quickcontrols2fluentwinui3styleimpl
|
set WINDEPLOYQT_ARGS=!WINDEPLOYQT_ARGS! --no-quickcontrols2fusionstyleimpl --no-quickcontrols2imaginestyleimpl --no-quickcontrols2universalstyleimpl --no-quickcontrols2windowsstyleimpl --no-quickcontrols2fluentwinui3styleimpl
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user