1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-09 23:17:29 +02:00

feat(server, web): accepted codecs (#6460)

* chore: rebase

* chore: open api

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Markus
2024-01-26 18:02:56 +01:00
committed by GitHub
parent 96b7885583
commit 8aef92affc
14 changed files with 181 additions and 10 deletions

View File

@@ -9,6 +9,8 @@ import 'package:openapi/api.dart';
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accel** | [**TranscodeHWAccel**](TranscodeHWAccel.md) | |
**acceptedAudioCodecs** | [**List<AudioCodec>**](AudioCodec.md) | | [default to const []]
**acceptedVideoCodecs** | [**List<VideoCodec>**](VideoCodec.md) | | [default to const []]
**bframes** | **int** | |
**cqMode** | [**CQMode**](CQMode.md) | |
**crf** | **int** | |

View File

@@ -14,6 +14,8 @@ class SystemConfigFFmpegDto {
/// Returns a new [SystemConfigFFmpegDto] instance.
SystemConfigFFmpegDto({
required this.accel,
this.acceptedAudioCodecs = const [],
this.acceptedVideoCodecs = const [],
required this.bframes,
required this.cqMode,
required this.crf,
@@ -34,6 +36,10 @@ class SystemConfigFFmpegDto {
TranscodeHWAccel accel;
List<AudioCodec> acceptedAudioCodecs;
List<VideoCodec> acceptedVideoCodecs;
int bframes;
CQMode cqMode;
@@ -69,6 +75,8 @@ class SystemConfigFFmpegDto {
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigFFmpegDto &&
other.accel == accel &&
_deepEquality.equals(other.acceptedAudioCodecs, acceptedAudioCodecs) &&
_deepEquality.equals(other.acceptedVideoCodecs, acceptedVideoCodecs) &&
other.bframes == bframes &&
other.cqMode == cqMode &&
other.crf == crf &&
@@ -90,6 +98,8 @@ class SystemConfigFFmpegDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(accel.hashCode) +
(acceptedAudioCodecs.hashCode) +
(acceptedVideoCodecs.hashCode) +
(bframes.hashCode) +
(cqMode.hashCode) +
(crf.hashCode) +
@@ -108,11 +118,13 @@ class SystemConfigFFmpegDto {
(twoPass.hashCode);
@override
String toString() => 'SystemConfigFFmpegDto[accel=$accel, bframes=$bframes, cqMode=$cqMode, crf=$crf, gopSize=$gopSize, maxBitrate=$maxBitrate, npl=$npl, preset=$preset, refs=$refs, targetAudioCodec=$targetAudioCodec, targetResolution=$targetResolution, targetVideoCodec=$targetVideoCodec, temporalAQ=$temporalAQ, threads=$threads, tonemap=$tonemap, transcode=$transcode, twoPass=$twoPass]';
String toString() => 'SystemConfigFFmpegDto[accel=$accel, acceptedAudioCodecs=$acceptedAudioCodecs, acceptedVideoCodecs=$acceptedVideoCodecs, bframes=$bframes, cqMode=$cqMode, crf=$crf, gopSize=$gopSize, maxBitrate=$maxBitrate, npl=$npl, preset=$preset, refs=$refs, targetAudioCodec=$targetAudioCodec, targetResolution=$targetResolution, targetVideoCodec=$targetVideoCodec, temporalAQ=$temporalAQ, threads=$threads, tonemap=$tonemap, transcode=$transcode, twoPass=$twoPass]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'accel'] = this.accel;
json[r'acceptedAudioCodecs'] = this.acceptedAudioCodecs;
json[r'acceptedVideoCodecs'] = this.acceptedVideoCodecs;
json[r'bframes'] = this.bframes;
json[r'cqMode'] = this.cqMode;
json[r'crf'] = this.crf;
@@ -141,6 +153,8 @@ class SystemConfigFFmpegDto {
return SystemConfigFFmpegDto(
accel: TranscodeHWAccel.fromJson(json[r'accel'])!,
acceptedAudioCodecs: AudioCodec.listFromJson(json[r'acceptedAudioCodecs']),
acceptedVideoCodecs: VideoCodec.listFromJson(json[r'acceptedVideoCodecs']),
bframes: mapValueOfType<int>(json, r'bframes')!,
cqMode: CQMode.fromJson(json[r'cqMode'])!,
crf: mapValueOfType<int>(json, r'crf')!,
@@ -205,6 +219,8 @@ class SystemConfigFFmpegDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'accel',
'acceptedAudioCodecs',
'acceptedVideoCodecs',
'bframes',
'cqMode',
'crf',

View File

@@ -21,6 +21,16 @@ void main() {
// TODO
});
// List<AudioCodec> acceptedAudioCodecs (default value: const [])
test('to test the property `acceptedAudioCodecs`', () async {
// TODO
});
// List<VideoCodec> acceptedVideoCodecs (default value: const [])
test('to test the property `acceptedVideoCodecs`', () async {
// TODO
});
// int bframes
test('to test the property `bframes`', () async {
// TODO