You've already forked FrameTour-RenderWorker
refactor(worker): 合并渲染和TS封装任务为单一处理流程
- 将 RENDER_SEGMENT_VIDEO 和 PACKAGE_SEGMENT_TS 任务类型合并为 RENDER_SEGMENT_TS - 移除独立的 PackageSegmentTsHandler,将其功能集成到 RenderSegmentTsHandler 中 - 更新任务执行器中的 GPU 资源分配配置 - 修改单元测试以适配新的任务类型名称 - 在 TaskType 枚举中保留历史任务类型的兼容性标记 - 更新常量定义和默认功能配置中的任务类型引用 - 添加视频精确裁剪和 TS 封装功能到渲染处理器中
This commit is contained in:
@@ -21,7 +21,7 @@ class _DummyHandler(BaseHandler):
|
||||
return TaskResult.ok({})
|
||||
|
||||
def get_supported_type(self):
|
||||
return TaskType.RENDER_SEGMENT_VIDEO
|
||||
return TaskType.RENDER_SEGMENT_TS
|
||||
|
||||
|
||||
def _create_handler(tmp_path):
|
||||
|
||||
@@ -4,7 +4,7 @@ import pytest
|
||||
|
||||
from domain.config import WorkerConfig
|
||||
from domain.task import Effect, OutputSpec, RenderSpec
|
||||
from handlers.render_video import RenderSegmentVideoHandler
|
||||
from handlers.render_video import RenderSegmentTsHandler
|
||||
|
||||
|
||||
class _DummyApiClient:
|
||||
@@ -20,7 +20,7 @@ def _create_handler(tmp_path):
|
||||
cache_enabled=False,
|
||||
cache_dir=str(tmp_path / 'cache')
|
||||
)
|
||||
return RenderSegmentVideoHandler(config, _DummyApiClient())
|
||||
return RenderSegmentTsHandler(config, _DummyApiClient())
|
||||
|
||||
|
||||
def test_get_zoom_params_with_valid_values():
|
||||
|
||||
@@ -7,7 +7,7 @@ import util.tracing as tracing_module
|
||||
|
||||
|
||||
def _create_task_stub():
|
||||
task_type = SimpleNamespace(value="RENDER_SEGMENT_VIDEO")
|
||||
task_type = SimpleNamespace(value="RENDER_SEGMENT_TS")
|
||||
return SimpleNamespace(
|
||||
task_id="task-1001",
|
||||
task_type=task_type,
|
||||
@@ -28,7 +28,7 @@ def test_task_trace_scope_sets_and_resets_context(monkeypatch):
|
||||
context = tracing.get_current_task_context()
|
||||
assert context is not None
|
||||
assert context.task_id == "task-1001"
|
||||
assert context.task_type == "RENDER_SEGMENT_VIDEO"
|
||||
assert context.task_type == "RENDER_SEGMENT_TS"
|
||||
assert context.job_id == "job-2002"
|
||||
assert context.segment_id == "seg-3003"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user