Skip to content

Commit

Permalink
docs: 优化 demo 文档
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaohappy committed Feb 5, 2025
1 parent 52c8f9e commit 2bf672f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions site/docs/guide/threads.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const pipeline = await createThreadFromClass(
```javascript [node]

import DemuxPipeline from '@libmedia/avpipeline/DemuxPipeline'
import DemuxPipelineWorker from './worker'
import { Worker } from 'worker_threads'

const pipeline = await createThreadFromClass(
Expand All @@ -71,7 +70,7 @@ const pipeline = await createThreadFromClass(

:::

If you use vite for packaging, you need to add the following configuration for the worker:
If you use vite, you need to add the following configuration for the worker:


```javascript [vite]
Expand Down Expand Up @@ -108,7 +107,7 @@ export default defineConfig({

## Use Multi-Threads in webpack

If you are using webpack to build a project, it is recommended to use the webpack plugin to compile. For how to configure it, see [Configuration](./quick-start.md#webpack-plugin). This makes it easier to start multithreading, and there is no need to write a separate worker entry file; and the worker code will not be divided into separate files, it will be created by dynamically generating code at runtime.
If you are using webpack to build your project, it is recommended to use a webpack plugin for compilation. For how to configure it, see [Configuration](./quick-start.md#webpack-plugin). This approach simplifies enabling multi-threading, as it eliminates the need to manually create a separate worker entry file. Additionally, the multi-threaded code is not split into standalone files during compilation. Instead, workers are dynamically created at runtime through code generation.

```javascript

Expand Down
1 change: 0 additions & 1 deletion site/docs/guide/threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const pipeline = await createThreadFromClass(
```javascript [node]

import DemuxPipeline from '@libmedia/avpipeline/DemuxPipeline'
import DemuxPipelineWorker from './worker'
import { Worker } from 'worker_threads'

const pipeline = await createThreadFromClass(
Expand Down
2 changes: 1 addition & 1 deletion site/docs/guide/timebase.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 2
---
# Time base

Time base is a basic concept throughout libmedia, so you must master it. Time base is the unit of time. The data structure of time base is [Rational](https://zhaohappy.github.io/libmedia/docs/libmedia_api/classes/avutil_struct_rational.Rational.html) It represents a fraction, where den is the denominator and num is the numerator. It represents the number of seconds a unit is. For example, we now have a timestamp 100, and the time it represents in different time bases is as follows:
Time base is a basic concept throughout libmedia, so you must understand it. Time base is the unit of time. The data structure of time base is [Rational](https://zhaohappy.github.io/libmedia/docs/libmedia_api/classes/avutil_struct_rational.Rational.html). It represents a fraction, where den is the denominator and num is the numerator. It represents the number of seconds a unit is. For example, we now have a timestamp 100, and the time it represents in different time bases is as follows:

- ```{num: 1, den: 1000}``` This time base represents a unit of 1/1000 second, which is 1 millisecond, so 100 is 100*1/1000 second, which is 100 milliseconds; flv uses this time base.
- ```{num: 1, den: 90000}``` This time base means that one unit is 1/90000 second, so 100 is 100*1/90000 second, which is about 1.111 milliseconds; ts stream uses this time base.
Expand Down
2 changes: 1 addition & 1 deletion src/cheap
Submodule cheap updated 2 files
+99 −0 README.md
+99 −0 README_en.md

0 comments on commit 2bf672f

Please sign in to comment.