Previously, we just used the native sample rate for encoding. However, some encoders like libmp3lame doesn't support it. Therefore, we now use a supported sample rate (preferring the native one if possible).
FFmpeg requires audio data to be sent in a sequence of frames, each containing the same specific number of samples. Previously, we buffered input samples in FFmpegBackend. However, as the source and destination sample rates can now be different, we should buffer resampled data instead. swresample have an internal input buffer, so we now just forward all data to it and 'gradually' receive resampled data, at most one frame_size at a time. When there is not enough resampled data to form a frame, we will record the current offset and request for less data on the next call.
Additionally, this commit also fixes a flaw. When an encoder supports variable frame sizes, its frame size is reported to be 0, which breaks our buffering system. Now we treat variable frame size encoders as having a frame size of 160 (the size of a HLE audio frame).
We previously assumed that the first preferred sample format is planar, but that may not be true for all codecs. Instead we should find a supported sample format that is planar.
While YUV420P is widely used, not all encoders accept it (e.g. Intel QSV only accepts NV12). We should use the codec's preferred pixel format instead as we need to rescale the frame anyway.
This uses the mailbox model to move pixel downloading to its own thread, eliminating Nvidia's warnings and (possibly) making use of GPU copy engine.
To achieve this, we created a new mailbox type that is different from the presentation mailbox in that it never discards a rendered frame.
Also, I tweaked the projection matrix thing so that it can just draw the frame upside down instead of having the CPU flip it.
* audio_core: dsp_hle: implements fdk_aac decoder
* audio_core: dsp_hle: clean up and add comments
* audio_core: dsp_hle: move fdk include to cpp file
* audio_core: dsp_hle: detects broken fdk_aac...
... and refuses to initialize if that's the case
* audio_core: dsp_hle: fdk_aac: address comments...
... and rebase commits
* fdk_decoder: move fdk header to cpp file
* videocore/renderer_opengl/gl_rasterizer_cache: Move bits per pixel table out of function
GCC and MSVC copy the table at runtime with the old implementation, which is wasteful and prevents inlining. Unfortunately, static constexpr variables are not legal in constexpr functions, so the table has to be external.
Also replaced non-standard assert with DEBUG_ASSERT_MSG.
* fix case of table name in assert
* set table to private
* Core::Timing: Add multiple timer, one for each core
* revert clang-format; work on tests for CoreTiming
* Kernel:: Add support for multiple cores, asserts in HandleSyncRequest because Thread->status == WaitIPC
* Add some TRACE_LOGs
* fix tests
* make some adjustments to qt-debugger, cheats and gdbstub(probably still broken)
* Make ARM_Interface::id private, rework ARM_Interface ctor
* ReRename TimingManager to Timing for smaler diff
* addressed review comments
* HTTP_C::Implement Context::MakeRequest
* httplib: Add add_client_cert_ASN1 and set_verify
* HTTP_C: Fix request methode strings case in MakeRequest
* HTTP_C: clang-format and cleanups
* HTTP_C: Add comment about async in BeginRequest and BeginRequestAsync
* Update httplib to contain all the changes we need; adapt http_c and web_services to the changes in httplib; addressed minor review comments
* Add android-ifaddrs
* yuzu/CMakeLists: Disable implicit QString conversions
Now that all of our code is compilable with implicit QString
conversions, we can enforce it at compile-time by disabling them.
Co-Authored-By: Mat M. <lioncash@users.noreply.github.com>
* citra_qt: Remove lots of implicit QString conversions
Co-authored-by: Mat M. <mathew1800@gmail.com>
std::function is allowed to heap allocate if the size of the captures
associated with each lambda exceed a certain threshold. This prevents
potentially unnecessary reallocations from occurring.
This holds the archives which include the SelfNCCH archive which holds the RomFS files. If we don't reset it the LayeredFS class can't get destructed and mods files won't be released.
The original path (file_name.exefsdir) is still supported, but alternatively users can choose to put exefs patches in the same place as LayeredFS files (`load/mods/<Title ID>/exefs`).
Only enabled for NCCHs that do not have an override romfs.
LayeredFS files should be put in the `load` directory in User Directory. The directory structure is similar to yuzu's but currently does not allow named mods yet. Replacement files should be put in `load/mods/<Title ID>/romfs` while patches/stubs should be put in `load/mods/<Title ID>/romfs_ext`.
This implementation is different from Luma3DS's which directly hooks the SDK functions. Instead, we read the RomFS's metadata and figure out the directory and file structure. Then, relocations (i.e. replacements/deletions/patches) are applied. Afterwards, we rebuild the metadata, and assign 'fake' data offsets to the files. When we want to read file data from this rebuilt RomFS, we use binary search to find the last data offset smaller or equal to the given offset and read from that file (either from the original RomFS, or from replacement files, or from buffered data with patches applied) and any later files when length is not enough.
The code that rebuilds the metadata is pretty complex and uses quite a few variables to keep track of necessary information like metadata offsets. According to my tests, it is able to build RomFS-es identical to the original (but without trailing garbage data) when no relocations are applied.
The DIGIT filter was incorrectly implemented as preventing all digits. It actually limits the maximum digit count to max_digits, according to ctrulib and hardware testing.