Format cleanup and minor fixes
- Apply go formatting across internal packages - Clean up imports and code style
This commit is contained in:
parent
81773c46a1
commit
cf9422ad6b
|
|
@ -20,11 +20,11 @@ func NewDVDConfig() *DVDConvertConfig {
|
||||||
func (d *DVDConvertConfig) GetFFmpegArgs(inputPath, outputPath string, videoWidth, videoHeight int, videoFramerate float64, audioSampleRate int, isProgressive bool) []string {
|
func (d *DVDConvertConfig) GetFFmpegArgs(inputPath, outputPath string, videoWidth, videoHeight int, videoFramerate float64, audioSampleRate int, isProgressive bool) []string {
|
||||||
// Create a minimal videoSource for passing to BuildDVDFFmpegArgs
|
// Create a minimal videoSource for passing to BuildDVDFFmpegArgs
|
||||||
tempSrc := &convert.VideoSource{
|
tempSrc := &convert.VideoSource{
|
||||||
Width: videoWidth,
|
Width: videoWidth,
|
||||||
Height: videoHeight,
|
Height: videoHeight,
|
||||||
FrameRate: videoFramerate,
|
FrameRate: videoFramerate,
|
||||||
AudioRate: audioSampleRate,
|
AudioRate: audioSampleRate,
|
||||||
FieldOrder: fieldOrderFromProgressive(isProgressive),
|
FieldOrder: fieldOrderFromProgressive(isProgressive),
|
||||||
}
|
}
|
||||||
|
|
||||||
return convert.BuildDVDFFmpegArgs(inputPath, outputPath, d.cfg, tempSrc)
|
return convert.BuildDVDFFmpegArgs(inputPath, outputPath, d.cfg, tempSrc)
|
||||||
|
|
@ -59,16 +59,16 @@ func fieldOrderFromProgressive(isProgressive bool) string {
|
||||||
|
|
||||||
// DVDPresetInfo provides information about DVD-NTSC capability
|
// DVDPresetInfo provides information about DVD-NTSC capability
|
||||||
type DVDPresetInfo struct {
|
type DVDPresetInfo struct {
|
||||||
Name string
|
Name string
|
||||||
Description string
|
Description string
|
||||||
VideoCodec string
|
VideoCodec string
|
||||||
AudioCodec string
|
AudioCodec string
|
||||||
Container string
|
Container string
|
||||||
Resolution string
|
Resolution string
|
||||||
FrameRate string
|
FrameRate string
|
||||||
DefaultBitrate string
|
DefaultBitrate string
|
||||||
MaxBitrate string
|
MaxBitrate string
|
||||||
Features []string
|
Features []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDVDPresetInfo returns detailed information about the DVD-NTSC preset
|
// GetDVDPresetInfo returns detailed information about the DVD-NTSC preset
|
||||||
|
|
|
||||||
|
|
@ -206,8 +206,8 @@ func normalizeFrameRate(rate float64) string {
|
||||||
}
|
}
|
||||||
// Check for common framerates with tolerance
|
// Check for common framerates with tolerance
|
||||||
checks := []struct {
|
checks := []struct {
|
||||||
name string
|
name string
|
||||||
min, max float64
|
min, max float64
|
||||||
}{
|
}{
|
||||||
{"23.976", 23.9, 24.0},
|
{"23.976", 23.9, 24.0},
|
||||||
{"24.0", 23.99, 24.01},
|
{"24.0", 23.99, 24.01},
|
||||||
|
|
|
||||||
|
|
@ -9,26 +9,26 @@ import (
|
||||||
type DVDRegion string
|
type DVDRegion string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DVDNTSCRegionFree DVDRegion = "ntsc-region-free"
|
DVDNTSCRegionFree DVDRegion = "ntsc-region-free"
|
||||||
DVDPALRegionFree DVDRegion = "pal-region-free"
|
DVDPALRegionFree DVDRegion = "pal-region-free"
|
||||||
DVDSECAMRegionFree DVDRegion = "secam-region-free"
|
DVDSECAMRegionFree DVDRegion = "secam-region-free"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DVDStandard represents the technical specifications for a DVD encoding standard
|
// DVDStandard represents the technical specifications for a DVD encoding standard
|
||||||
type DVDStandard struct {
|
type DVDStandard struct {
|
||||||
Region DVDRegion
|
Region DVDRegion
|
||||||
Name string
|
Name string
|
||||||
Resolution string // "720x480" or "720x576"
|
Resolution string // "720x480" or "720x576"
|
||||||
FrameRate string // "29.97" or "25.00"
|
FrameRate string // "29.97" or "25.00"
|
||||||
VideoFrames int // 30 or 25
|
VideoFrames int // 30 or 25
|
||||||
AudioRate int // 48000 Hz (universal)
|
AudioRate int // 48000 Hz (universal)
|
||||||
Type string // "NTSC", "PAL", or "SECAM"
|
Type string // "NTSC", "PAL", or "SECAM"
|
||||||
Countries []string
|
Countries []string
|
||||||
DefaultBitrate string // "6000k" for NTSC, "8000k" for PAL
|
DefaultBitrate string // "6000k" for NTSC, "8000k" for PAL
|
||||||
MaxBitrate string // "9000k" for NTSC, "9500k" for PAL
|
MaxBitrate string // "9000k" for NTSC, "9500k" for PAL
|
||||||
AspectRatios []string
|
AspectRatios []string
|
||||||
InterlaceMode string // "interlaced" or "progressive"
|
InterlaceMode string // "interlaced" or "progressive"
|
||||||
Description string
|
Description string
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDVDStandard returns specifications for a given DVD region
|
// GetDVDStandard returns specifications for a given DVD region
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@ import (
|
||||||
// DetectionResult contains the results of interlacing analysis
|
// DetectionResult contains the results of interlacing analysis
|
||||||
type DetectionResult struct {
|
type DetectionResult struct {
|
||||||
// Frame counts from idet filter
|
// Frame counts from idet filter
|
||||||
TFF int // Top Field First frames
|
TFF int // Top Field First frames
|
||||||
BFF int // Bottom Field First frames
|
BFF int // Bottom Field First frames
|
||||||
Progressive int // Progressive frames
|
Progressive int // Progressive frames
|
||||||
Undetermined int // Undetermined frames
|
Undetermined int // Undetermined frames
|
||||||
TotalFrames int // Total frames analyzed
|
TotalFrames int // Total frames analyzed
|
||||||
|
|
||||||
// Calculated metrics
|
// Calculated metrics
|
||||||
InterlacedPercent float64 // Percentage of interlaced frames
|
InterlacedPercent float64 // Percentage of interlaced frames
|
||||||
|
|
@ -26,21 +26,21 @@ type DetectionResult struct {
|
||||||
Confidence string // "High", "Medium", "Low"
|
Confidence string // "High", "Medium", "Low"
|
||||||
|
|
||||||
// Recommendations
|
// Recommendations
|
||||||
Recommendation string // Human-readable recommendation
|
Recommendation string // Human-readable recommendation
|
||||||
SuggestDeinterlace bool // Whether deinterlacing is recommended
|
SuggestDeinterlace bool // Whether deinterlacing is recommended
|
||||||
SuggestedFilter string // "yadif", "bwdif", etc.
|
SuggestedFilter string // "yadif", "bwdif", etc.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detector analyzes video for interlacing
|
// Detector analyzes video for interlacing
|
||||||
type Detector struct {
|
type Detector struct {
|
||||||
FFmpegPath string
|
FFmpegPath string
|
||||||
FFprobePath string
|
FFprobePath string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDetector creates a new interlacing detector
|
// NewDetector creates a new interlacing detector
|
||||||
func NewDetector(ffmpegPath, ffprobePath string) *Detector {
|
func NewDetector(ffmpegPath, ffprobePath string) *Detector {
|
||||||
return &Detector{
|
return &Detector{
|
||||||
FFmpegPath: ffmpegPath,
|
FFmpegPath: ffmpegPath,
|
||||||
FFprobePath: ffprobePath,
|
FFprobePath: ffprobePath,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,15 +13,15 @@ import (
|
||||||
|
|
||||||
// HardwareInfo contains system hardware information
|
// HardwareInfo contains system hardware information
|
||||||
type HardwareInfo struct {
|
type HardwareInfo struct {
|
||||||
CPU string `json:"cpu"`
|
CPU string `json:"cpu"`
|
||||||
CPUCores int `json:"cpu_cores"`
|
CPUCores int `json:"cpu_cores"`
|
||||||
CPUMHz string `json:"cpu_mhz"`
|
CPUMHz string `json:"cpu_mhz"`
|
||||||
GPU string `json:"gpu"`
|
GPU string `json:"gpu"`
|
||||||
GPUDriver string `json:"gpu_driver"`
|
GPUDriver string `json:"gpu_driver"`
|
||||||
RAM string `json:"ram"`
|
RAM string `json:"ram"`
|
||||||
RAMMBytes uint64 `json:"ram_mb"`
|
RAMMBytes uint64 `json:"ram_mb"`
|
||||||
OS string `json:"os"`
|
OS string `json:"os"`
|
||||||
Arch string `json:"arch"`
|
Arch string `json:"arch"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detect gathers system hardware information
|
// Detect gathers system hardware information
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,12 @@ type BenchmarkProgressView struct {
|
||||||
textColor color.Color
|
textColor color.Color
|
||||||
onCancel func()
|
onCancel func()
|
||||||
|
|
||||||
container *fyne.Container
|
container *fyne.Container
|
||||||
statusLabel *widget.Label
|
statusLabel *widget.Label
|
||||||
progressBar *widget.ProgressBar
|
progressBar *widget.ProgressBar
|
||||||
currentLabel *widget.Label
|
currentLabel *widget.Label
|
||||||
resultsBox *fyne.Container
|
resultsBox *fyne.Container
|
||||||
cancelBtn *widget.Button
|
cancelBtn *widget.Button
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *BenchmarkProgressView) build() {
|
func (v *BenchmarkProgressView) build() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user